How to conditionally render widgets in iOS
Issue #984 The WidgetBundle lets us expose multiple widgets from a single widget extension It uses WidgetBundleBuilder to constructs a widget bundle’s body. In iOS 18, if we include ControlWidget then we need to check iOSApplicationExtension iOS 18. For now in Xcode 16 there’s a bug that prevents existing widgets from appearing in iOS 17. We can leverage WidgetBundleBuilder to conditionally render widgets for each iOS version import SwiftUI import WidgetKit import Widgets @main struct OurAppWidgetBundle: WidgetBundle { var body: some Widget { if #available(iOSApplicationExtension 18....