When you select tinted your widget is rendered in accented mode. Accented mode splits the UI elements into two groups, the default group and the accented group. Basically you only get two colors the accented group will get the tinted color the other group is white. You swap your UI elements between the groups using the widgetAccentable modifier: https://developer.apple.com/documentation/swiftui/view/widgetaccentable(_:)
You can still apply an opacity to the UI elements if you want. If you want them to be the original color then you can use the https://developer.apple.com/documentation/widgetkit/widgetaccentedrenderingmode property but that only applies to Image elements.
Post
Replies
Boosts
Views
Activity
I get the same problem in multiple other places for example just running an SCNAction and having a completion handler also throws an error inside SceneKit, it seems like SceneKit is completely unusable with Swift6 enabled, I'm not sure how it can be so broken unless I'm doing something wrong, very frustrating.
It is more efficient if you reuse the same geometry instance across all SCNNode instances, so create it outside the loop, then you will only get one draw call for all the spheres instead of one draw call per node.
It doesn't seem like you can reduce the draw calls using multiple entities, but instead I used the new LowLevelMesh to render lots of geometry available in iOS18.
We were also having this issue. It was recommended to make sure that any images you have aren't too big, ideally somewhere around the size of the widget dimensions, that should help fix this problem. Reducing the size of the images we were using as backgrounds to our widgets seems to have helped us.
Great, thank you!
Was this ever clarified by an Apple employee?
It doesn't seem like we should have to tick the diagnostics box based on the statement: "You are not responsible for disclosing data collected by Apple." for crash logs and diagnostics provided in the xcode interface, otherwise every app in the app store would have to have this option checked if it was required.
The WeatherKit option is un the Capabilities tab not App Services. You also need to register a WeatherKit key in the top level Keys section in the developer site. Once you have completed both of those step, this question has information on how to call the REST API using a JWT: https://developer.apple.com/forums/thread/707418
Did you enable WeatherKit in the apps Signing & Capabilities section for the app?
Unfortunately, entering my real apple ID/password does not work. It show success but the upgrade/downgrade never occurs the UI still shows the original subscription level.
Signing out of the production AppleID and only having the sandbox tester on the device doesn't work either. In that scenario the password box is displayed but with an empty username in the dialog, entering the sandbox password just fails.
I'm confused how people are successfully testing these scenarios :/
There is no guarantee that getSnapshot will be called each time the galley is opened, the OS might cache previous results as you've seen.
In the case the user has never logged in to the app and adds the widget, so their is no previous cached data in your getSnapshot call you could check the auth status of your app and if the user is logged out:
Show a "Logged out" UI in the widget
Show some canned data to fill out your widget with example data (to make it look good in the gallery).
Then once the user logs in via the app you can get the widget to refresh its UI by calling: https://developer.apple.com/documentation/widgetkit/widgetcenter/reloadalltimelines()
For the other case where you don't want cached data in the gallery once the user logs out, you could try calling reloadAllTimelines() when the user logs out in the app and see if that causes the snapshot to be updated.
If you set the supportedFamilies modifier on the WidgetConfiguration to [] then the widget no longer shows in the widget gallery. That might be an option.
e.g.
public var body: some WidgetConfiguration {
StaticConfiguration(
kind: kind,
provider: Provider()
) { entry in
widget_mainEntryView(entry: entry)
}
.configurationDisplayName("Foo")
.description("Foo")
.supportedFamilies([])
}
You need to make sure you have both these plist values set in your widgets Info.plist file:
<key>NSWidgetWantsLocation</key>
<true/>
<key>NSLocationUsageDescription</key>
<string>Put some text here</string>
Then when you open the widget gallery, looks like from beta5 onwards iOS will show a prompt asking you to allow/deny location permissions to the widget.
The next important thing is that inside getTimeline() if you are creating an instance of CLLocationManager you must keep a reference to it past the end of the getTimeline call otherwise no updates will happen on the delegate. In my case I just created a wrapper class that the widget stores as a property then I setup the CLLocationManager instance on the first run of getTimeline and assign it to a field in the wrapper class.
At least this worked for me :)
I have an app with WidgetKit running on iOS13 using xcode beta6. I was getting a crash as well, to fix it I added the WidgetKit.framework binary to my app target and marked it "optional" and now the app loads.
To make sure iOS13 code doesn't try to call WidgetCenter I just wrap the calls in:
if #available(iOS 14, *) {
WidgetCenter.shared.reloadAllTimelines()
}
I'm not sure if this would work for your case but you could just add a field like "applyRedaction" to your entry object, set that to true in the case where your widget doesn't have permission, fill in the rest of the field with static data like you do in getSnapshot() and return the entry from getTimeline using the completion method as in the success case.
Then in your widget main entry struct where the view is returned you can just manually apply the redaction based on the value of the applyRedaction value e.g.
if entry.applyRedaction {
	return AnyView(Text("Hello").redacted(reason: .placeholder))
} else {
	return AnyView(Text("Hello"))
}
I use this pattern in my widget to just show a redacted view of my widget in the case that there are any transient network errors.