Thanks for taking a look. I tried some more things and it looks like it's a misleading compiler error, maybe nothing to do with the path variable at all even though the compiler says it is.
I took the path variable out of the function temporarily, then it gave another error: "Task or actor isolated value cannot be sent; this is an error in the Swift 6 language mode".
The containing class is marked as @Observable, so I'm assuming really it is complaining that "self" is getting pulled into the Task which can cause race conditions even though the compiler error does not say that. I added the Sendable protocol to the container class and the warning went away.
Thanks for taking the time to look into it.
Side note: Swift6 makes writing code miserable, it's so broken still, good idea poor execution.
Post
Replies
Boosts
Views
Activity
I'm seeing the same. It used to work in previous versions of Xcode but not in 16.1, must be a bug.
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.
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 :)