I have the following code in my WidgetBundle class, but I want to remove the @available tag since as is, if the user is not iOS 16, they won't have access to Home Screen or Lock Screen widgets at all.
struct WidgetBundler: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
HomeScreenWidget()
LockScreenWidget()
}
}
The compiler does not like this code, and it was the only other way I could think of to get around this issue:
struct WidgetBundler: WidgetBundle {
@WidgetBundleBuilder
var body: some Widget {
if #available(iOSApplicationExtension 16, *) {
HomeScreenWidget()
LockScreenWidget()
} else {
HomeScreenWidget()
}
}
}
How do I remove the @available tag and get it so users can access the Home Screen widgets even on iOS 14 and 15?