Created
December 23, 2016 03:15
-
-
Save jverkoey/62a3ab1d03789ab8b22fb8ac44a3a7c5 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
#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