Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 646
Grazor Avatar asked Oct 01 '20 14:10

Grazor


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

like image 52
Grazor Avatar answered Nov 19 '22 09:11

Grazor