第一种:
UIView.animate(withDuration: 0.3) {
self.arrowImageView.layer.transform = CATransform3DRotate(self.arrowImageView.layer.transform, .pi, 1.0, 0.0, 0.0)
}
第二种:
arrowImageView.transform = .identity //默认
arrowImageView.transform = CGAffineTransform.init(rotationAngle: .pi) //翻转180°
if isShowList {
arrowImageView.transform = CGAffineTransform.init(rotationAngle: .pi)
} else {
arrowImageView.transform = .identity
}
网友评论