V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
iOS 开发实用技术导航
NSHipster 中文版
http://nshipster.cn/
cocos2d 开源 2D 游戏引擎
http://www.cocos2d-iphone.org/
CocoaPods
http://cocoapods.org/
Google Analytics for Mobile 统计解决方案
http://code.google.com/mobile/analytics/
WWDC
https://developer.apple.com/wwdc/
Design Guides and Resources
https://developer.apple.com/design/
Transcripts of WWDC sessions
http://asciiwwdc.com
Cocoa with Love
http://cocoawithlove.com/
Cocoa Dev Central
http://cocoadevcentral.com/
NSHipster
http://nshipster.com/
Style Guides
Google Objective-C Style Guide
NYTimes Objective-C Style Guide
Useful Tools and Services
Charles Web Debugging Proxy
Smore
rookiemaster
V2EX  ›  iDev

ios 开发怎么使用低版本的包

  •  
  •   rookiemaster · 50 天前 · 1140 次点击
    这是一个创建于 50 天前的主题,其中的信息可能已经有所发展或是发生改变。

    比如我现在在使用 MapKit ,但 MapKit 上面存在注释:

    @available(iOS 17.0, macOS 14.0, watchOS 10.0, tvOS 17.0, *)
    

    也就是说只能在 ios17 以上设备使用,但是我想在 ios16 设备上使用,要怎么使用低版本的 MapKit 。 还是说只有在 ios17 的时候才存在 MapKit ,那要在低版本设备上显示地图应该用什么包。

    5 条回复    2024-03-12 11:22:18 +08:00
    oneyian
        1
    oneyian  
       50 天前
    if (@available(iOS 17.0, *)) {
    // 17.0 及之后
    }else {
    // 之前 ...
    // code
    }
    oneyian
        2
    oneyian  
       50 天前
    直接使用原生 MKMapView 显示地图
    rookiemaster
        3
    rookiemaster  
    OP
       50 天前
    @oneyian MKMapView 好像不能在 swiftui 下用
    iOCZS
        4
    iOCZS  
       50 天前
    @rookiemaster uikit view 需要封装一下给 SwiftUI 使用
    shawndev
        5
    shawndev  
       47 天前
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5340 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 09:19 · PVG 17:19 · LAX 02:19 · JFK 05:19
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.