Kai Huppmann
Kai Huppmann

Reputation: 10775

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?

Upvotes: 10

Views: 2629

Answers (3)

Mona
Mona

Reputation: 6175

Select iOS 14 for your new target

enter image description here

Upvotes: 1

Krits
Krits

Reputation: 85

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.

Upvotes: 3

Roland Lariotte
Roland Lariotte

Reputation: 3498

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.

Upvotes: 5

Related Questions