Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I add WidgetKit extensions to an app with target iOS < 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?

like image 312
Kai Huppmann Avatar asked Jul 28 '20 09:07

Kai Huppmann


3 Answers

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.

like image 124
Roland Lariotte Avatar answered Jan 01 '23 18:01

Roland Lariotte


Yes it is possible! WidgetKit is only an extension added to your application that would render on devices which support that particular extension. You can definitely create an app that would run on devices <= or > iOS14, iPadOS14, macOS11 and so on and the widget for the same which would be rendered on devices >= iOS14, iPadOS14, macOS11. WidgetKit is just an added facility to your application just like there are certain features of an application that can run on higher devices but not on old versioned devices.

like image 21
Krits Avatar answered Jan 01 '23 18:01

Krits


Select iOS 14 for your new target

enter image description here

like image 23
Mona Avatar answered Jan 01 '23 19:01

Mona