Created
December 8, 2015 15:08
-
-
Save christopherweems/4b2fd4ffd9983a1d77b8 to your computer and use it in GitHub Desktop.
Convert from UIViewAnimationCurve to UIViewAnimationCurveOptions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Simple function converting from UIViewAnimationCurve to UIViewAnimationCurveOptions | |
// Not all UIViewAnimationCurve values have a specified equivalent UIViewAnimationCurveOptions, | |
// making it tricky to use the animation curve of the keyboard with UIView.animateWithDuration(...) API. | |
// This works as late as iOS 9.1, but could change in the future. | |
extension UIViewAnimationCurve { | |
func toOptions() -> UIViewAnimationOptions { | |
return UIViewAnimationOptions(rawValue: UInt(rawValue << 16)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment