Hey,
I need to know the size of the widget in advance in order to create a proper UI for my widget. This works great by using the displaySize property provided by the TimelineProviderContext.
However so far I did not find any way to get the widget size for my placeholder view. Since I don't have a provider, I have no TimelineProviderContext and thus no displaySize.
Is there any way to know the widget size in the placeholder?
Here is a code snippet where I would need to pass the widget size to the PlaceholderView view:
Thanks in advance!
I need to know the size of the widget in advance in order to create a proper UI for my widget. This works great by using the displaySize property provided by the TimelineProviderContext.
However so far I did not find any way to get the widget size for my placeholder view. Since I don't have a provider, I have no TimelineProviderContext and thus no displaySize.
Is there any way to know the widget size in the placeholder?
Here is a code snippet where I would need to pass the widget size to the PlaceholderView view:
Code Block swift struct MyWidget: Widget { public var body: some WidgetConfiguration { StaticConfiguration(kind: myWidgetKind, provider: Provider(), placeholder: PlaceholderView()) { entry in WidgetEntryView(entry) } .configurationDisplayName("Display Name") .description("Description") .supportedFamilies([.systemSmall, .systemMedium]) } }
Thanks in advance!