ios - 如何使用@available 定位低于特定操作系统的 iOS 设备

标签 ios swift

<分区>

我有一个针对 iOS 11+ 的功能,标记如下:

@available(iOS 11.0, *)

现在我需要为低于 iOS 11 的 iOS 版本定位一个不同的函数。我该如何编写?

最佳答案

if #available(iOS 11.0, *) {} else {
    // do something (pre iOS 11.0)
}

关于ios - 如何使用@available 定位低于特定操作系统的 iOS 设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48478679/

相关文章:

ios - Swift UITableView 删除所选行及其上方的任何行

iphone - 如何使用 UITextInputMode

ios - 在 cllocationdistance 中转换数据时出现问题

ios - 如何在 Swift 3 的 Table Cell 中设置多行 UILabel?

swift - 我不明白我的代码中的 Property 'self.heading' not initialized at super.init 调用错误

ios - 为什么我在文本字段中的左 View 不起作用?

swift - Swift 中的线程安全方法操作成本

ios - 图像目录中矢量 pdf 的渲染模式设置为模板,但 UIImageView 不会在自定义单元格中为图像着色

ios - FBSDKLoginManager logInWithReadPermissions?

ios - 重新启动游戏游戏中心