Post

Replies

Boosts

Views

Activity

Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer I am sorry this is an CloudKit project with entitlements, I don't want to post it in a public forum. You can download it from the Feedback FB22670187. Considerable effort has gone in creating a sample project, so I hope this is being investigated. Regarding the bug, I genuinely think it is a bug, if the team thinks otherwise, please reply to the feedback.
2d
Reply to CloudKit Query (and Dashboard) returns only a few records
Sorry if this is something that you are already aware of. Take it with a pinch of salt as my knowledge on this is a bit rusty. Could you check the following? CKQueryOperation.resultsLimit is responsible for the number of record returned. It might be 100, which could be why you get in batches of 100. You can change this value. Is [[CKQueryOperation alloc] initWithCursor:theCursor] is actually getting hit for refetching remaining records ? CKQueryOperation.configuration for qualityOfService. The default qualityOfService might be utility which may not be what you desire. You might need to set it higher qos depending on your needs. If [[CKQueryOperation alloc] initWithCursor:theCursor] is actually hit but the last one didn't complete then it could be the qualityOfService. Try setting it to userInitiated. Just curious It is interesting you are using a public database, is this user data stored in public database or common content? If it is private user data, then would be better to use private database. Even the quota for public database would be counted against your app.
2d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Albert, If it is not a lot of trouble would it be possible to check with the SwiftData / CoreData / CloudKit regarding the following: What is the background task ID for the background task? (so that the app can allow it and not block it) It would be greatly helpful to know this because this is done by the framework and by blocking it we might lose some functionality that Apple had intended to provide. Thanks!
2d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer, That feedback is for a different issue. Should I create a separate feedback for this task id issue? I was suggesting that project for you to download and test on real device to reproduce the error. If you think you want me to create a separate feedback let me know. I already have a TSI opened and waiting for their response on it. Just got only an automated message. Is there a timeframe for someone to respond to TSI?
3d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Albert, thanks for the response. Error Please see the screenshot of the fault log, Subsystem for the log iscom.apple.cloudkit Category for the log is Scheduler Answer to your questions: Cloud sync works and data gets synced, no issue with the data. Yes correct primary sync doesn't happen via BGTaskScheduler. However SwiftData / CloudKit initiates a background task to do some processing. The background is the one that gets blocked. This is a clean new project (no 3rd party libraries) and I have written the code so I am sure of that there is no background task I am initiating. Testing / Sample project: If you really want to test it, please refer to the project attached in FB22634797 Though FB22634797 is for a different issue, the Xcode project would throw the fault log in Xcode. It is a very simple project. Question It would be great if someone from SwiftData / CoreData / CloudKit team can confirm this.
3d
Reply to SwiftData with CloudKit Error: Error updating background task request
Just to be clear this is not a background task I have initiated. This is something done internally by SwiftData. That is the reason I would like to know the background task id. If I don't then the whole background processing would be blocked and defeats the purpose of the SwiftData background processing. This doesn't seem to be documented anywhere. Even if there is a way to debug this please let me know as symbolic breakpoints that I tried don't seem to work. Any help on this would be greatly appreciated.
3d
Reply to 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
@DTS Engineer Questions Can you confirm if it is ok to use ColorComponents as Coddle and ignore the fault log? 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Or what is the best approach? I could store it as Data, however having to decode every time seems to be expensive especially when displaying In a list. I am kind of stuck with this, could you please help, thanks!
5d
Reply to 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
@DTS Engineer could you please add CloudKit tag to this post, I am unable to add it, thanks! My Solution I have managed to get it working on the app target with ValueTransformer and NSSecureCoding but kind of seems odd to store just a normal struct using so much boilerplate code. Way to reproduce this The issue is not reproducible on SwiftData only. Only when you have SwiftData + CloudKit this occurs. CloudKit minimum reproducible code often requires turning on project setup with capabilities etc. Problem On the app target things work ok but for test cases there is a crash as it can't convert from Data to ColorRepresentation. I have the same file added to 2 different targets, not sure if it has anything with the names and module names because the error seems to suggest it. Error Domain=NSCocoaErrorDomain Code=4864 "value for key 'root' was of unexpected class 'ColorRepresentation' (0x10326c828) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app]. Allowed classes are: {( "'ColorRepresentation' (0x103d98520) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app/PlugIns/WidgetStylesDemoTests.xctest]" )}" UserInfo={NSDebugDescription=value for key 'root' was of unexpected class 'ColorRepresentation' (0x10326c828) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app]. Allowed classes are: {( "'ColorRepresentation' (0x103d98520) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app/PlugIns/WidgetStylesDemoTests.xctest]" )}} Documentation / Videos: I wish there are some documentation around SwiftData + CloudKit custom types.
6d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer I am sorry this is an CloudKit project with entitlements, I don't want to post it in a public forum. You can download it from the Feedback FB22670187. Considerable effort has gone in creating a sample project, so I hope this is being investigated. Regarding the bug, I genuinely think it is a bug, if the team thinks otherwise, please reply to the feedback.
Replies
Boosts
Views
Activity
2d
Reply to SwiftData with CloudKit Error: Error updating background task request
Thanks @DTS Engineer I have created a feedback FB22670187 It contains a sample project and also attached a video Run it on a real device The video shows the log being generated on Xcode. Look at the subsystem of the log, it is from com.apple.cloudkit It contains details about the fault and how to reproduce it.
Replies
Boosts
Views
Activity
2d
Reply to CloudKit Query (and Dashboard) returns only a few records
Sorry if this is something that you are already aware of. Take it with a pinch of salt as my knowledge on this is a bit rusty. Could you check the following? CKQueryOperation.resultsLimit is responsible for the number of record returned. It might be 100, which could be why you get in batches of 100. You can change this value. Is [[CKQueryOperation alloc] initWithCursor:theCursor] is actually getting hit for refetching remaining records ? CKQueryOperation.configuration for qualityOfService. The default qualityOfService might be utility which may not be what you desire. You might need to set it higher qos depending on your needs. If [[CKQueryOperation alloc] initWithCursor:theCursor] is actually hit but the last one didn't complete then it could be the qualityOfService. Try setting it to userInitiated. Just curious It is interesting you are using a public database, is this user data stored in public database or common content? If it is private user data, then would be better to use private database. Even the quota for public database would be counted against your app.
Replies
Boosts
Views
Activity
2d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Albert, If it is not a lot of trouble would it be possible to check with the SwiftData / CoreData / CloudKit regarding the following: What is the background task ID for the background task? (so that the app can allow it and not block it) It would be greatly helpful to know this because this is done by the framework and by blocking it we might lose some functionality that Apple had intended to provide. Thanks!
Replies
Boosts
Views
Activity
2d
Reply to SwiftData with CloudKit Error: Error updating background task request
Thanks for your responses.
Replies
Boosts
Views
Activity
3d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer, That feedback is for a different issue. Should I create a separate feedback for this task id issue? I was suggesting that project for you to download and test on real device to reproduce the error. If you think you want me to create a separate feedback let me know. I already have a TSI opened and waiting for their response on it. Just got only an automated message. Is there a timeframe for someone to respond to TSI?
Replies
Boosts
Views
Activity
3d
Reply to SwiftData with CloudKit Error: Error updating background task request
@DTS Engineer Albert, thanks for the response. Error Please see the screenshot of the fault log, Subsystem for the log iscom.apple.cloudkit Category for the log is Scheduler Answer to your questions: Cloud sync works and data gets synced, no issue with the data. Yes correct primary sync doesn't happen via BGTaskScheduler. However SwiftData / CloudKit initiates a background task to do some processing. The background is the one that gets blocked. This is a clean new project (no 3rd party libraries) and I have written the code so I am sure of that there is no background task I am initiating. Testing / Sample project: If you really want to test it, please refer to the project attached in FB22634797 Though FB22634797 is for a different issue, the Xcode project would throw the fault log in Xcode. It is a very simple project. Question It would be great if someone from SwiftData / CoreData / CloudKit team can confirm this.
Replies
Boosts
Views
Activity
3d
Reply to SwiftData with CloudKit Error: Error updating background task request
Just to be clear this is not a background task I have initiated. This is something done internally by SwiftData. That is the reason I would like to know the background task id. If I don't then the whole background processing would be blocked and defeats the purpose of the SwiftData background processing. This doesn't seem to be documented anywhere. Even if there is a way to debug this please let me know as symbolic breakpoints that I tried don't seem to work. Any help on this would be greatly appreciated.
Replies
Boosts
Views
Activity
3d
Reply to 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
@DTS Engineer Questions Can you confirm if it is ok to use ColorComponents as Coddle and ignore the fault log? 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release Or what is the best approach? I could store it as Data, however having to decode every time seems to be expensive especially when displaying In a list. I am kind of stuck with this, could you please help, thanks!
Replies
Boosts
Views
Activity
5d
Reply to 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
@DTS Engineer could you please add CloudKit tag to this post, I am unable to add it, thanks! My Solution I have managed to get it working on the app target with ValueTransformer and NSSecureCoding but kind of seems odd to store just a normal struct using so much boilerplate code. Way to reproduce this The issue is not reproducible on SwiftData only. Only when you have SwiftData + CloudKit this occurs. CloudKit minimum reproducible code often requires turning on project setup with capabilities etc. Problem On the app target things work ok but for test cases there is a crash as it can't convert from Data to ColorRepresentation. I have the same file added to 2 different targets, not sure if it has anything with the names and module names because the error seems to suggest it. Error Domain=NSCocoaErrorDomain Code=4864 "value for key 'root' was of unexpected class 'ColorRepresentation' (0x10326c828) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app]. Allowed classes are: {( "'ColorRepresentation' (0x103d98520) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app/PlugIns/WidgetStylesDemoTests.xctest]" )}" UserInfo={NSDebugDescription=value for key 'root' was of unexpected class 'ColorRepresentation' (0x10326c828) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app]. Allowed classes are: {( "'ColorRepresentation' (0x103d98520) [/Users/homefolder/Library/Developer/CoreSimulator/Devices/E365C6A9-B19A-4A53-8885-05E9DE4D8B84/data/Containers/Bundle/Application/BE80DEBA-5FAF-496A-99CC-E60A8C72A096/WidgetStylesDemo.app/PlugIns/WidgetStylesDemoTests.xctest]" )}} Documentation / Videos: I wish there are some documentation around SwiftData + CloudKit custom types.
Replies
Boosts
Views
Activity
6d
Reply to 'NSKeyedUnarchiveFromData' should not be used to for un-archiving and will be removed in a future release
This SwiftData is synced to CloudKit. Is there any requirement that custom property (struct) needs to implement / conform to any protocol? Seems find when it is just SwiftData without CloudKit sync, I feel the issue happens only with CloudKit
Replies
Boosts
Views
Activity
6d
Reply to Developer app on the Mac doesn't play videos in full screen
Thanks @DTS Engineer (Quinn) and @B347, yes it has been fixed, thanks a lot!
Replies
Boosts
Views
Activity
Mar ’26
Reply to Developer app on the Mac doesn't play videos in full screen
Thanks @DTS Engineer Quinn, I don't have a spare mac to update and try macOS 26.3 beta, would it be ok if I check once 26.3 is released? Thanks.
Replies
Boosts
Views
Activity
Jan ’26
Reply to AppIntents
@DTS Engineer Thanks a lot Ed! that was spot on, exactly what I wanted. I was breaking my head over this!
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Navigation title flickers when tab is changed when used with a List / Form
The current accepted answer is incorrect so please mark it as unanswered. Please have a look at the feedback FB21436493
Topic: UI Frameworks SubTopic: SwiftUI
Replies
Boosts
Views
Activity
Dec ’25