When I run my widget from xcode I see getTimeline is called twice for some reason.
It's called the first time, then after it returns a timeline it's called again. The logs have the following message:
"-[EXSwiftUI_Subsystem beginUsing:withBundle:] unexpectedly called multiple times."
It takes about 0.5 seconds for the first getTimeline call to return so it doesn't seem like the OS should try to call this method again so quickly (my timeline entries all have times in the future so they shouldn't request the widget to load immediately)
Is this a bug, or expected? Seems to happen every time I run the widget.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
In this WWDC talk about liquid glass https://developer.apple.com/videos/play/wwdc2025/219/ they mention that there are two variants of liquid glass, regular and clear.
I don't see any way to try the clear variant using the .glassEffect() APIs, they only expose regular, is there some other way to try the clear variant?
Hi,
I am trying to test my subscription upgrade/downgrade path on a device. I added a test user to the sandbox section of Settings - App Store and can purchase subscriptions using that test user no problem in my app.
However, if I click on "Manage" on the sandbox user to see the list of subscriptions, when I try to upgrade/downgrade the purchase UI that iOS shows tries to use my actual personal account instead of the sandbox user, so I can't complete the transaction.
Looks like a bug in the sandbox testing flow in iOS, but any way around it? Right now I just simulate updates from apple on my backend to make sure my app behaves as expected, but I would like to actually get some "real" data from Apple.
After updating our app some of our users are seeing that their widget has gone blank, the whole widget it just white. The only way to make the widget render again is to reboot the phone. This seems to be happening randomly and mainly on iOS17.
Looking on the web, seems like other people are also having this issue so hopefully Apple will make a fix at some point but I'm wondering if other people have had this issue and figured out a workaround to stop it happening?
Thanks.
I'm trying to fix some Swift6 warnings, this one seems too strict, I'm not sure how to fix it. The variable path is a String, which should be immutable, it's a local variable and never used again inside of the function, but still Swift6 complains about it being a race condition, passing it to the task
What should I do here to fix the warning?
Is it possible to tell in your code if the app was launched from an app intent action in a widget.
In my SwiftUI code it has something like Button(intent: MyIntent()) I want to be able to tell when the user has clicked on the button to launch the app, because I need some different setup code to run before the intent perform method is called.
Thanks
In SwiftUI sliders now have tick marks by default on iOS26, how do you turn them off or hide them? This WWDC talk had some sample code on how to set the tick marks but it doesn't compile for me: https://developer.apple.com/videos/play/wwdc2025/323/
I don't see any available methods or initializers to turn them off.
I'm trying to develop a widget, I've been using a custom font. If I add the widget to the home screen maybe 70% of the time it will load, then randomly it will just start to fail and continually crash, just flashing white.
If I add multiple instances of the widget to my home screen then it will just crash 100% of the time. Both widget will just sit flashing and continually crash.
In the crash logs on my device I can see SwiftUI is crashing, on something relating to fonts:
0 SwiftUI 0x00000001e5c52f5c CodablePlatformFont.init+ 6733660
If I take the custom font out of the widget then it will load (eventually after resetting the device, widgets are sooo buggy) and I can have multiple instances.
I'm not sure if I am doing something wrong trying to use the custom font. I created a new project and included the same custom font and loaded it the same way (just adding it to the bundle and in the info.plist) and that does not seem to crash.
Just wondering if this is a known issue with custom fonts, if anyone has a workaround to stop it happening.
Here is a snippet of the crash stack:
Date/Time:					 2020-08-21 13:26:32.7104 -0700
Launch Time:				 2020-08-21 13:26:32.2918 -0700
OS Version:					iPhone OS 14.0 (18A5351d)
Release Type:				Beta
Baseband Version:		3.50.05
Report Version:			104
Exception Type:	EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001e5c52f5c
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [8244]
Triggered by Thread:	0
Thread 0 name:	Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0	 SwiftUI											 0x00000001e5c52f5c CodablePlatformFont.init+ 6733660 (from:) + 2744
1	 SwiftUI											 0x00000001e5c52c54 CodablePlatformFont.init+ 6732884 (from:) + 1968
2	 SwiftUI											 0x00000001e5c52f88 protocol witness for Decodable.init+ 6733704 (from:) in conformance CodablePlatformFont + 20
3	 libswiftCore.dylib						 0x00000001b6feff80 dispatch thunk of Decodable.init+ 2957184 (from:) + 16
4	 libswiftFoundation.dylib			 0x00000001e3e1dd0c __PlistDecoder.unbox<A>+ 343308 (_:as:) + 372
5	 libswiftFoundation.dylib			 0x00000001e3e28860 _PlistKeyedDecodingContainer.decode<A>+ 387168 (_:forKey:) + 660
6	 libswiftFoundation.dylib			 0x00000001e3e2ac94 protocol witness for KeyedDecodingContainerProtocol.decode<A>+ 396436 (_:forKey:) in conformance _PlistKeyedDecodingContainer<A> + 48
7	 libswiftFoundation.dylib			 0x00000001e3e2a9f4 protocol witness for KeyedDecodingContainerProtocol.decode<A>+ 395764 (_:forKey:) in conformance _PlistKeyedDecodingContainer<A> + 20
8	 libswiftCore.dylib						 0x00000001b6d722cc _KeyedDecodingContainerBox.decode<A, B>+ 344780 (_:forKey:) + 296
9	 libswiftCore.dylib						 0x00000001b6d659e4 KeyedDecodingContainer.decode<A>+ 293348 (_:forKey:) + 40
10	SwiftUI											 0x00000001e5c4f5c8 CodableAttributes.init+ 6718920 (from:) + 832
11	SwiftUI											 0x00000001e5c503c4 protocol witness for Decodable.init+ 6722500 (from:) in conformance CodableAttributes + 20
12	libswiftCore.dylib						 0x00000001b6feff80 dispatch thunk of Decodable.init+ 2957184 (from:) + 16
13	libswiftFoundation.dylib			 0x00000001e3e1dd0c __PlistDecoder.unbox<A>+ 343308 (_:as:) + 372
14	libswiftFoundation.dylib			 0x00000001e3e2b32c _PlistUnkeyedDecodingContainer.decode<A>+ 398124 (_:) + 776
15	libswiftFoundation.dylib			 0x00000001e3e2d150 protocol witness for UnkeyedDecodingContainer.decode<A>+ 405840 (_:) in conformance _PlistUnkeyedDecodingContainer + 12
16	libswiftCore.dylib						 0x00000001b6d7cbd0 Array<A>.init+ 388048 (from:) + 332
17	libswiftCore.dylib						 0x00000001b6d7d178 protocol witness for Decodable.init+ 389496 (from:) in conformance <A> [A] + 28
18	libswiftCore.dylib						 0x00000001b6d7cc8c protocol witness for Decodable.init+ 388236 (from:) in conformance <A> [A] + 20
19	libswiftCore.dylib						 0x00000001b6feff80 dispatch thunk of Decodable.init+ 2957184 (from:) + 16
20	libswiftFoundation.dylib			 0x00000001e3e1dd0c __PlistDecoder.unbox<A>+ 343308 (_:as:) + 372
21	libswiftFoundation.dylib			 0x00000001e3e28860 _PlistKeyedDecodingContainer.decode<A>+ 387168 (_:forKey:) + 660
NOTE: I am using the beta5 build
I'm not sure which combination of iOS/XCode/Mac OS is causing this issue, but all of a sudden when I try to run our SceneKit app and the "Scheme -> Diagnostics -> Metal -> API Validation" setting is turned off the scene won't render and the console is just full of the following errors:
Execution of the command buffer was aborted due to an error during execution. Invalid Resource (00000009:kIOGPUCommandBufferCallbackErrorInvalidResource)
[SceneKit] Error: Main command buffer execution failed with status 5, error: Error Domain=MTLCommandBufferErrorDomain Code=9 "Invalid Resource (00000009:kIOGPUCommandBufferCallbackErrorInvalidResource)"
)
If you run the app outside of xcode it's fine, also enabling the "API Validation" option stops the issue.
One of my schemes has this option disabled since the project began and never had an issue before. Just throwing this out there incase someone else has spent hours of their life trying to figure out why this is not working for them.
Also you can just create a new SceneKit project and turn that diagnostic option off and the app won't render anything.
If you use the iOS16 Swift WeatherKit API you can get the weather data attribution logo doing something like:
// Skipping full syntax for example
let attribution = WeatherService.shared.attribution
// A URL to an image you can show along with the weather data
attribution.combinedMarkLightURL
What about if you are not using the iOS16 WeatherKit wrappers e.g. you are using the REST API on your own server to return data. The API docs show a providerLogo/providerName parameter in the metadata returned from the service, but they don't seem to be populated right now.
Is it ok just to use a unicode Apple logo to make a string instead like:
Weather
Also in the API there is a metadata object returned in each dataset e.g. current, daily, hourly which each has an attributionURL field, will all those values always be the same or we might have to display multiple URLs for data sources, the Swift example seems to just have one attribution object.
Why does the documentation say this field returns the intensity of precipitation in UnitSpeed, this seems confusing. Shouldn't the amount of precipitation be an amount like inch/hr, mm/hr why would the value be in speed?
The old dark sky documentation for this field shows the units were returned in inches/hour
Does WeatherKit work for users in China? Some of our APIs to fetch weather data from other sources have been blocked in China, we are hoping WeatherKit will work as a replacement for them (we are using the Swift APIs to integrate with WeatherKit).
Hopefully calling WeatherKit using the Swift APIs inside China from an iOS device will return data successfully and not fail.
Thanks.
If you exceed the monthly quota in your WeatherKit plan what happens when you make an API call (Swift SDK), does it just error out? Will Apple give you some grace period to upgrade your quota to a larger value before stopping you from being able to make queries?
I'm seeing a decent number of crash reports from our app where SceneKit is crashing internally relating to SCNPhysicsField. The stack looks like:
objc_msgSend
-[SCNPhysicsField _removeOwner]
-[SCNNode dealloc]
AutoreleasePoolPage::releaseUntil(objc_object**)
-[UIApplication _run]
UIApplicationMain
main
start
It must be that I am removing a node that has a physics field on it and it randomly crashes.
Probably threading related? Anyone know if there is a workaround, maybe setting physicsField to nil first before trying to remove the node?
Thanks
I'm trying to render a large number of entities, it looks like each ModelEntity causes a draw call, even if you share the ModelComponent so each Entity shares the mesh and materials.
I tried to use the MeshInstanceCollection inside MeshResource to generate a large number of objects in the scene, the code works and draws many objects but the draw count is still one call per instance, this seems strange I would assume it should only be one draw call for the single entity since I have specified to use instancing in the resource.
Has anybody else successfully used instancing in RealityKit to draw a large number go Entities (maybe around 10,000) or drawn this amount of items successfully with 60fps any other way?
Here is some sample code that draws 100 cubes using instancing but still causes 100 draw calls.
func instanceTest(scene: RealityKit.Scene) {
var resource = MeshResource.generateBox(size: 0.2)
var contents = MeshResource.Contents()
contents.models = resource.contents.models
var arr: [MeshResource.Instance] = []
var matrix = matrix_identity_float4x4
matrix[3, 0] = 0.5
for i in 0..<100 {
let inst = MeshResource.Instance(id: "\(i)", model: "MeshModel", at: matrix)
arr.append(inst)
}
contents.instances = MeshInstanceCollection(arr)
let updatedResource = try? MeshResource.generate(from: contents)
let unlitMaterial = UnlitMaterial(color: .red)
let modelEntity = ModelEntity(
mesh: updatedResource!,
materials: [unlitMaterial]
)
let anchor = AnchorEntity()
anchor.addChild(modelEntity)
scene.addAnchor(anchor)
}