iOS7 and Apple Watch

大憨熊 提交于 2019-12-03 05:54:44

问题


I have a app with the minimum iOS target iOS7.

I am considering in add some extra features with the apple watch. Theres is any option to maintain the iOS7 as the minimum target and still add support for apple watch if the app is running on a iOS 8? Something like the extensions/widgets of the iOS8.

Thanks in advance


回答1:


You can set your deployment target to iOS7.x and make sure you build against iOS8.2 SDK. You will need to set the frameworks as optional (weak linking) in your build settings and perform run time checks to ensure you don't attempt anything with them on an iOS7.x device.

Optional frameworks will resolve as nil in an app where the framework is not linked.




回答2:


Yes, it's possible by weak linking WatchKit and performing runtime checks if required classes are available. Check this out on Raywenderlich.




回答3:


In my case the only thing I had to do was creating the extension with Objective-C (Swift is not allowed on some iOS versions) and downgrading the Extension app target version to 8.2 instead of 8.3.



来源:https://stackoverflow.com/questions/27509935/ios7-and-apple-watch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!