Shipping WidgetKit widgets in an app that supports older iOS versions

My main app supports down to iOS 12 and I'd like to include a WidgetKit extension with my app. Is there a way to optionally include/load this extension such that it only shows up on devices running iOS 14 but the main app still runs on iOS 12?
Answered by ekurutepe in 626962022
Answering my own question:

Xcode was auto-resolving WidgetKit and implicitly adding it as a required framework. Adding it manually as an optional framework fixed the issue.

Hope this helps somebody.
Accepted Answer
Answering my own question:

Xcode was auto-resolving WidgetKit and implicitly adding it as a required framework. Adding it manually as an optional framework fixed the issue.

Hope this helps somebody.
Shipping WidgetKit widgets in an app that supports older iOS versions
 
 
Q