I have multiple widgets that are for iOS 14 users and above. But with the new lockscreen widgets, it’s only available to iOS 16 users. How can I only make the bottom two widgets for iOS 16 users? If I uncomment the top line then I believe it will make all widgets only available to iOS 16 users but I can’t do that, I want my users to be able to continue using the home screen widgets if they’re on iOS 14-15.
import WidgetKit
import SwiftUI
//@available(iOSApplicationExtension 16.0, *)
@main
struct Widgets: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
Widget1()
Widget2()
Widget3()
LockscreenWidget1()
LockscreenWidget2()
}
}
2
Answers
You need to configure it inside your Widget logics.
e.g.