我以前是这样旋转图片的:
self.image.transform = CGAffineTransformRotate(self.image.transform,
CGFloat(M_PI))
但是这段代码对于按钮无效:
let rotateAnimation = CABasicAnimation(keyPath: "transform.rotation")
rotateAnimation.fromValue = 0.0
rotateAnimation.toValue = CGFloat(M_PI)
但我不知道如何将该旋转赋给按钮,我该怎么做?