ios - 在代码中检测 iOS 模拟器中是否打开/关闭慢速动画

标签 ios xcode animation core-animation ios-simulator

我想以编程方式检测模拟器中是否打开或关闭慢速动画。

像这样的东西会很方便。

IPHONE_SIMULATOR_SLOW_ANIMATIONS_ENABLED()

这仅用于开发目的。

最佳答案

幸运的是这很容易:

float UIAnimationDragCoefficient(void);

static inline BOOL slowAnimationsEnabled()
{
#if TARGET_IPHONE_SIMULATOR
    return UIAnimationDragCoefficient() != 1;
#else
    return NO;
#endif
}

关于ios - 在代码中检测 iOS 模拟器中是否打开/关闭慢速动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13275294/

相关文章:

ios - 在 App-Group 文件夹中创建 Realm 文件在 WatchOS(WatchKit 扩展)下不起作用

ios - 解析 PFUser CurrentUser 返回 Null

ios - 在 Interface Builder 中使用自定义字体设计标签/ TextView

javascript - 影响其他元素的 CSS Fade

JavaScript->CSS : display ="";?

ios - 如何在 RxCocoa 中为自定义按钮添加控件事件?

ios - mupdf 没有在 xcode 中构建

xcode - React Native/EXPO/iOS 模拟器卡住 @ 'Downloading Javascript Bundle 100%'

ios - 我是否必须注册新的 Bundle ID 才能将新应用程序上传到 iTune Connect?

ios - 执行 UIViewControllerAnimatedTransitioning 时隐藏快照 View