本章内容概览:iOS系统及设备(系统判断、版本兼容等)
同系列文章请查看:快乐码元 - iOS篇
1.系统判断
1 | #if os(tvOS) |
2.版本兼容
1 | // 版本 |
3.canImport 判断库是否可使用
1 | #if canImport(SpriteKit) |
4.targetEnvironment 环境的判断
1 | #if targetEnvironment(simulator) |
参考资料:
- A Swift Tour- Apple:https://docs.swift.org/swift-book/GuidedTour/GuidedTour.html#//apple_ref/doc/uid/TP40014097-CH2-ID1
- 菜鸟教程:https://www.runoob.com/swift/swift-enumerations.html
- 在线网站:https://onlineswiftplayground.com/
- SwiftGG:https://swiftgg.gitbook.io/swift/huan-ying-shi-yong-swift
- 斯坦福yt教程:https://www.youtube.com/watch?v=bqu6BquVi2M
- Apple官方40mins教程:https://developer.apple.com/tutorials/swiftui/creating-and-combining-views
Tips: Please indicate the source and original author when reprinting or quoting this article.