Skip to content

Instantly share code, notes, and snippets.

@jverkoey
Created December 23, 2016 03:15
Show Gist options
  • Save jverkoey/62a3ab1d03789ab8b22fb8ac44a3a7c5 to your computer and use it in GitHub Desktop.
Save jverkoey/62a3ab1d03789ab8b22fb8ac44a3a7c5 to your computer and use it in GitHub Desktop.
#if (arch(i386) || arch(x86_64)) && os(iOS)
@_silgen_name("UIAnimationDragCoefficient") func UIAnimationDragCoefficient() -> Float
func simulatorDragCoefficient() -> CGFloat {
let drag = UIAnimationDragCoefficient()
if drag > 1 {
return CGFloat(drag)
}
return 1
}
#else
func simulatorDragCoefficient() -> CGFloat {
return 1
}
#endif
// Example usage: duration * simulatorDragCoefficient()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment