uiviewanimation-curve

Adding curveEaseIn to Swift Animation

跟風遠走 提交于 2021-02-08 03:41:15
问题 I have an image that rotates but it stops abruptly. I'd like to add curveEaseOut to make it stop smoother, but when I add the animations: .curveEaseOut, I get an error. 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 } } I keep getting an error: Type '() -> Void' has no member 'curveEaseOut' I've also

How to force a raw value of 7 into a UIViewAnimationCurve enum?

淺唱寂寞╮ 提交于 2019-12-06 20:41:38
问题 The key UIKeyboardAnimationCurveUserInfoKey in the userInfo dictionary of a UIKeyboardWillShowNotification contains an Int with the value 7 . Now I need to pass this Int into UIView.setAnimationCurve(<here>) . I tried to create the required UIViewAnimationCurve enum like this UIViewAnimationCurve(rawValue: 7) . Because the raw value 7 is undocumented, the result is always nil . It works fine this way in Objective-C. Any idea how to get this animation curve from the notification into a UIView

How to force a raw value of 7 into a UIViewAnimationCurve enum?

£可爱£侵袭症+ 提交于 2019-12-05 01:43:30
The key UIKeyboardAnimationCurveUserInfoKey in the userInfo dictionary of a UIKeyboardWillShowNotification contains an Int with the value 7 . Now I need to pass this Int into UIView.setAnimationCurve(<here>) . I tried to create the required UIViewAnimationCurve enum like this UIViewAnimationCurve(rawValue: 7) . Because the raw value 7 is undocumented, the result is always nil . It works fine this way in Objective-C. Any idea how to get this animation curve from the notification into a UIView animation using Swift? Update: As pointed out by Martin, this is no longer a problem since Xcode 6.3.