我可以将WidgetKit扩展添加到目标iOS< 14吗 [英] Can I add WidgetKit extensions to an app with target iOS < 14?

查看:84
本文介绍了我可以将WidgetKit扩展添加到目标iOS< 14吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将(WidgetKit-)小部件添加到我的iOS应用中.应用程序本身应保持< 14.显然,该窗口小部件将仅在> = 14的那些设备上可用,但该应用程序也应在所有其他设备上运行.这可能吗?

I want to add a (WidgetKit-)widget to my iOS app. The app itself should keep a target of < 14. Obviously, the widget would be available only on those devices >= 14, but the app should run on all other devices as well. Is this possible?

推荐答案

是的,您可以在iOS13 Xcode项目上开发微件. 您可以在运行iOS14的iPhone上看到它们,而不能在iOS13上看到它们. 您只需要在代码中添加@available(iOS14),因为您正在使用WidgetKit.但是不用担心,Xcode会很好地提醒您. 这是WidgetKit框架,在iOS14,iPadOS14或macOS11下不可用.

Yes, you can as I develop the Widgets on an iOS13 Xcode project. You can see them on an iPhone that runs iOS14 and not on the iOS13 one. You just need to add @available(iOS14) in your code because you are using WidgetKit. But don't worry, Xcode will remind it to you nicely. This is the WidgetKit framework that is not available under iOS14, iPadOS14 or macOS11.

这篇关于我可以将WidgetKit扩展添加到目标iOS&lt; 14吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆