简体   繁体   English

iOS7和Apple Watch

[英]iOS7 and Apple Watch

I have a app with the minimum iOS target iOS7. 我有一个最低iOS目标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? Theres是将iOS7维持为最低目标的任何选项,如果应用程序在iOS 8上运行,仍然可以添加对Apple Watch的支持吗? Something like the extensions/widgets of the iOS8. 类似于iOS8的扩展/小部件。

Thanks in advance 提前致谢

You can set your deployment target to iOS7.x and make sure you build against iOS8.2 SDK. 您可以将部署目标设置为iOS7.x,并确保针对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 (弱链接)并执行运行时检查,以确保您不会在iOS7.x设备上尝试使用它们。

Optional frameworks will resolve as nil in an app where the framework is not linked. 在没有链接框架的应用程序中,可选框架将解析为nil

Yes, it's possible by weak linking WatchKit and performing runtime checks if required classes are available. 是的,如果需要的类可用,可以通过弱链接WatchKit和执行运行时检查来实现。 Check this out on Raywenderlich . Raywenderlich上看看这个。

在我的情况下,我唯一要做的就是使用Objective-C创建扩展(某些iOS版本不允许使用Swift)并将Extension app目标版本降级为8.2而不是8.3。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM