Post

Replies

Boosts

Views

Activity

Reply to Widget showsWidgetContainerBackground fallback
showswidgetcontainerbackground is iOS15+ according to Apple's docs. But I am seeing crash "Thread 1: EXC_BAD_ACCESS (code=1, address=0x0)" when run on iOS16. I have FB open on this: FB12554533 (showsWidgetContainerBackground Environment variable crashes widget extension on iOS16 with Xcode 15) I was tabling this issue for a few weeks in hopes it gets resolved. Feels like a bug that would hit a lot of people. But perhaps how I am using it is triggering the crash.
Jul ’23
Reply to Widget showsWidgetContainerBackground fallback
Check your runtime warnings in Xcode. I have seen it tell me the SwiftUI environment variables can only be used in a view. In my widgets I already have a wrapper view to handle a lot of common things & bootstrap. I have a view "WidgetSetStuff" that sets global variables -- or it could adjust a class object passed in. struct WidgetEntryView : View { ... @Environment(\.widgetFamily) var widgetFamily @Environment(\.showsWidgetContainerBackground) var showsWidgetContainerBackground var body: some View { ... WidgetSetStuff( family: widgetFamily, noMargins: showsWidgetContainerBackground == false, ... ) ... } WidgetSetStuff constructor sets some globals use elsewhere and has EmptyView() body.
Jul ’23
Reply to Will Lock Screen Widgets be Configurable?
Yes the UI is terrible. I have a Feedback to allow long press on widget to edit. Crazy it is not supported. I am making a video for my users because I find it so non-intuitive. I encourage everyone to file a FB requesting long press to initiate edit support. My original question was when the intent system was going to be supported on lock screen widgets. It took many betas for it to be added.
Sep ’22