我有一个旋转的图像,但它突然停止。我想添加 curveEaseOut 以使其停止更平滑,但是当我添加动画时:.curveEaseOut,我得到一个错误。
func rotateRight () {
let rotation = 90.0
let transform = imageGearRight.transform
let rotated = transform.rotated(by: CGFloat(rotation))
UIView.animate(withDuration: 0.5, animations: .curveEaseOut) {
self.imageGearRight.transform = rotated
}
}
我不断收到错误消息:类型 '() -> Void' 没有成员 'curveEaseOut'
我也试过这段代码,但我也得到一个错误:
UIView.animate(withDuration: 0.5, animations: UIViewAnimationCurve.easeOut) {
self.imageGearRight.transform = rotated
}
不知道我错过了什么。任何帮助,将不胜感激!!