Can I disable specific widget sizes in SwiftUI iOS 14

Viewed 961

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

Is it possible to disable SystemLarge/Medium?

Thanks

1 Answers

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

Related