I want to programatically detect if slow animations is on or off in simulator.
Something like this would be handy.
IPHONE_SIMULATOR_SLOW_ANIMATIONS_ENABLED()
This is for development purposes only.
How to do this in Swift 3.0:
@_silgen_name("UIAnimationDragCoefficient") func UIAnimationDragCoefficient() -> Float
func slowAnimationsEnabled() -> Bool {
return UIAnimationDragCoefficient() != 1.0
}
Note that unfortunately you can't use TARGET_IPHONE_SIMULATOR
at compile time in Swift, and you should not include this in your App Store submissions as you may be rejected for using private APIs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With