Search code examples
iosswiftuiwidgetios14

Can I disable specific widget sizes in SwiftUI iOS 14


Do we need to have all 3 system sizes available for widgets in iOS 14?

Is it possible to disable SystemLarge/Medium?

Thanks


Solution

  • Found the answer

        var body: some WidgetConfiguration {
        IntentConfiguration(kind: kind, intent: ConfigurationIntent.self, provider: Provider()) { entry in
            TestWidgetEntryView(entry: entry)
        }
        .supportedFamilies([.systemSmall, .systemMedium])
        .configurationDisplayName("My Widget")
        .description("This is an example widget.")
    }
    

    You can add .supportedFamilies([.systemSmall, .systemMedium]) in the @main functions