Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save miguellara/9e498715ee93540d79e9 to your computer and use it in GitHub Desktop.
Save miguellara/9e498715ee93540d79e9 to your computer and use it in GitHub Desktop.
UIViewAnimationCurve to UIViewAnimationOptions
import UIKit
func viewAnimationOptionForCurve(curve: UIViewAnimationCurve) -> UIViewAnimationOptions {
switch (curve) {
case .EaseInOut:
return UIViewAnimationOptions.CurveEaseInOut
case .EaseIn:
return UIViewAnimationOptions.CurveEaseIn
case .EaseOut:
return UIViewAnimationOptions.CurveEaseOut
case .Linear:
return UIViewAnimationOptions.CurveLinear
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment