Post

Replies

Boosts

Views

Activity

Ignore Home Screen Tint/Accents in Colored Components
I'm having some trouble getting my widget to display how I want when the user has a tint applied to their home screen. The issue I'm having is with a Text() element, as well as a LinearGradient I am displaying on top of my image. The text should always be white, and the gradient is always black with varying levels of opacity. I've managed to fix this issue with images displayed in my widget by leveraging widgetAccentedRenderingMode(.fullColor) however, there does not seem to be an equivalent of this for non-Image components. I'm aware of .widgetAccentable(false) but as I understand it, elements are already considered not accentable by default and you need to explicitly declare widgetAccentable(true) to add them to the accent group. I've tried specifying this to be false up and down my view hierarchy just to see if something will stick but no luck. Are there any other levers I can pull to preserve the declared colors for my text and gradient components? The images I am displaying is album artwork where preserving the original image is integral, but the tinted text color and overlaid gradient often clash or just looks bad in general. Is there a solution for colored primitive elements?
0
0
50
3w
Widget Memory Limit - Per Widget Kind/Size or Per Target?
I am building a widget that supports 2 different widget kinds, each supporting systemSmall, systemMedium, and systemLarge size families. My widget does download and display images so I expect memory usage to be on the higher end, but in debugging some memory issues, I notice that when I build my widget scheme to a physical device, things start off reasonable at ~12MB of memory usage. But as I change the widgets intent, add the other widget kind, or add different widget size families, this memory usage grows until it ultimately hits the 30MB cap. My question is, is the 30MB memory limit spread across all my supported widget kinds/sizes? Or does each individual widget get its own 30MB cap? i.e., if I have systemMedium Widget A and systemLarge Widget B, are they sharing that 30MB memory limit?
1
0
70
Aug ’25
Feature Flagging Widgets & Widget Families
I am trying to feature flag widgets in my Widget extension. This feature flag value is stored remotely, read by my main app, and written to UserDefaults, then read from UserDefaults in my widget target. I understand that providing an empty array of WidgetFamilys will not show my app when the user goes to add a widget. However, even when this flag flips to true, hard-closing and reopening my app will not show my app in the list of apps you can add a widget for. But I notice that if I recompile my app from Xcode (running the app's scheme, not the widget scheme), then my app will show when you search for an app to add a widget for, making me think that these Widget objects are only created by the system once when the app is initially installed/updated. My concern is that I will not be able to flip this flag from false to true after the user has installed my app to do a rollout of my widget. Is this expected? Or is there an alternative or otherwise recommended way of doing this? struct MyWidget: Widget { let kind = "MyWidget" var supportedFamilies: [WidgetFamily] { let manager = ExtensionManager() if manager.widgetsEnabled { return [.systemSmall, .systemMedium, .systemLarge] } else { return [] } } var body: some WidgetConfiguration { IntentConfiguration( kind: kind, intent: MyWidgetIntent.self, provider: MyWidgetProvider() ) { entry in MyWidgetView(entry: entry) } .configurationDisplayName("My Widget") .description("Install my widget!") .supportedFamilies(supportedFamilies) } }
0
0
100
Jul ’25