我有这段代码可以旋转我的imageview,但是当我按下我的暂停按钮时我想旋转速度为0.我该怎么做?如何将Swift中的旋转速度降低为0?
@IBAction func playButtonL(sender: AnyObject) {
rotation.toValue = NSNumber(double: M_PI * 2)
rotation.duration = 2
rotation.cumulative = true
rotation.repeatCount = FLT_MAX
self.leftCircleImageView.layer.addAnimation(rotation, forKey: "rotationAnimation")
}
@IBAction func pauseButtonR(sender: AnyObject) {
}
它的作品,但我有一个问题是,它停止时,它会回到原来的位置。我希望它停止在它的位置。 – coding22
接受答案,如果它适合你。 – amorbytes