Created
April 15, 2016 13:14
-
-
Save ateliercw/6182e6bc46924a3ca20075c11349f5ef to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public extension UIViewKeyframeAnimationOptions { | |
// This exists because keyframe options doesn't expose the easing for the overall curve | |
public init(keyframeAnimationsOptions: UIViewKeyframeAnimationOptions, animationCurve: UIViewAnimationCurve) { | |
let animationOptions: UIViewAnimationOptions | |
switch animationCurve { | |
case .EaseIn: animationOptions = .CurveEaseIn | |
case .EaseInOut: animationOptions = .CurveEaseInOut | |
case .EaseOut: animationOptions = .CurveEaseOut | |
case .Linear: animationOptions = .CurveLinear | |
} | |
self = UIViewKeyframeAnimationOptions(rawValue: keyframeAnimationsOptions.rawValue | animationOptions.rawValue) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment