Search results for

“SwiftData inheritance relationship”

4,986 results found

Post

Replies

Boosts

Views

Activity

Reply to Using multiple apple-developer-merchantid-domain-association files to support Apple Pay through different payment gateways
Hi @milesg000, Please see my reply to the post you mentioned for the expected behavior: Multiple Apple Pay relationships with differing apple-developer-merchantid-domain-association files https://developer.apple.com/forums/thread/695538?answerId=874306022#874306022 Cheers, Paris X Pinkney |  WWDR | DTS Engineer
Topic: Safari & Web SubTopic: General Tags:
Feb ’26
Reply to [FB21797091] Regression: Universal Links/AASA Fetching Fails for IDN on iOS 16+
Thank you for verifying the AASA on Apple's CDN, Albert. Let me clarify the points you raised: 1. URL-Encoded Paths in AASA The URL-encoded characters in the paths are intentional and correct. These represent Japanese text in URL paths: URL-Encoded Decoded (Japanese) Meaning %E3%81%AE%E4%BB%95%E4%BA%8B の仕事 jobs %E9%9A%9C%E3%81%8C%E3%81%84%E8%80%85%E6%8E%A1%E7%94%A8 障がい者採用 disability employment Per RFC 3986, non-ASCII characters in URL paths must be percent-encoded. This is the standard approach for internationalized URLs and should not cause issues with AASA parsing. 2. Relationship Between 求人ボックス.com and xn--pckua2a7gp15o89zb.com These are the same domain: 求人ボックス.com — Unicode/display form (IDN) xn--pckua2a7gp15o89zb.com — Punycode/wire form The AASA is correctly hosted at the Punycode domain (https://xn--pckua2a7gp15o89zb.com/.well-known/apple-app-site-association), and as you confirmed, it is successfully synced to Apple's CDN. 3. The Core Issue Based on swcutil_show.txt, the problem appears to be
Topic: App & System Services SubTopic: General Tags:
Feb ’26
Reply to Bug? SwiftData + inheritance + optional many-to-one relationship
I encountered another bug with SwiftData and inheritance and reported it (FB21837287). This one is not related to CloudKit. Briefly, SwiftData crashes during auto-save when the schema contains: A base @Model class with at least one subclass (inheritance) A separate @Model class with a reference to the base class The crash occurs specifically when: There is a class inheritance hierarchy (Beta: Alpha) A separate class (Standalone) has a reference typed as the base class (Alpha?) Changing the reference from var ref: Alpha? to var ref: Beta? (subclass) eliminates the crash.
Feb ’26
Basic introduction to DEXT Matching and Loading
Note: This document is specifically focused on what happens after a DEXT has passed its initial code-signing checks. Code-signing issues are dealt with in other posts. Preliminary Guidance: Using and understanding DriverKit basically requires understanding IOKit, something which isn't entirely clear in our documentation. The good news here is that IOKit actually does have fairly good foundational documentation in the documentation archive. Here are a few of the documents I'd take a look at: IOKit Fundamentals IOKit Device Driver Design Guidelines Accessing Hardware From Applications Special mention to QA1075: Making sense of IOKit error codes,, which I happened to notice today and which documents the IOReturn error format (which is a bit weird on first review). Those documents do not cover the full DEXT loading process, but they are the foundation of how all of this actually works. Understanding the IOKitPersonalities Dictionary The first thing to understand here is that the IOKitPersonalities is called that
2
0
325
Jan ’26
How to figure out sync errors in Production?
I'm using SwiftData with CloudKit private database. I was able to identify the error on my device by debugging in Xcode with com.apple.CoreData.SQLDebug flag. However, in Production, I couldn't find a way to get the cause of errors. I tried inspecting the error coming from eventChangedNotification. The NSPersistentCloudKitContainer.Event error does not contain any underlying error (neither CKError.userInfo nor in NSError.underlyingError). It only reports a partial failure with CKErrorDomain code 2. If a user encounter an error, there seems to be no way to retrieve the error details. Is there any way to access the error details or logs in Production?
1
0
254
Jan ’26
Technical Issue: Internal API Version Mismatch (Iris v1 vs. v2) in App Store Connect Game Center Dashboard
Summary There is a critical synchronization issue within the App Store Connect dashboard affecting the management of Game Center Leaderboards. The web interface attempts to perform administrative tasks (such as listing player entries or moderating scores) by calling deprecated or mismatched API endpoints across different versions of the Iris API (v1 and v2), leading to a complete failure of the management UI. I have tried it with multiple browsers (Safari, Mozilla, Chrome, Opera) with same results. Observed Behavior Management UI Failure: The Manage Scores and Players section fails to load, often showing Blocked status in the browser's Network tab or remaining stuck on a loading spinner. API Version Conflict: While some parts of the dashboard successfully fetch app data via /iris/v1/, the leaderboard management logic appears to have been partially migrated to /iris/v2/. This results in the UI making calls to /v1/ resources that return 403 FORBIDDEN (GET_COLLECTION not allowed) or calling /v2/ paths that retur
0
0
102
Jan ’26
Naming Collision Between Model Attribute and Enum Case in SwiftData and CloudKit
There is a conflict in SwiftData (specifically when synced with CloudKit) when a @Model attribute shares the same name as a case within its assigned enum type. When this occurs, accessing the attribute on a model instance consistently returns the value corresponding to the enum case name, rather than the actual value persisted in the database. Steps to Reproduce Define an enumeration (e.g., Status) with a case that matches a planned property name (e.g., case status). Create a SwiftData @Model that uses this enum. Name the property in the model the same as the enum case. Attempt to save and then retrieve the value. Example Code enum TaskStatus: String, Codable { case status // The conflict source case pending case completed } @Model class TodoItem { // Conflict: Property name matches enum case name var status: TaskStatus init(status: TaskStatus) { self.status = status } } Expected Behavior The property item.status should return the value stored in the database (e.g., .pending or .completed).
2
0
101
Jan ’26
Reply to evaluatedPolicyDomainState
I’m not sure what sort of help you’re expecting me to provide here. As I mentioned above, this looks like a bug to me. If I had a bug report with a sysdiagnose log, I might — and I want to stress the might here — be able to offer more insight. But without that, I’m flying completely blind. In terms of a workaround, I see two potential options: You could explore user-level workarounds with your user. For example: You might have them reset Face ID (Settings > Face ID & Passcode > Reset Face ID) and re-enroll. Or have them disable the device passcode and then re-enable it. Or have them back up their device and restore from that backup. All of these things are common patterns for clearing out mysterious problems. You could explore code-level workarounds. For example: You might change your system to record multiple biometric domain states. Or have an option to disable biometric domain state checking for specific users. It’s hard to offer specific advice on either of these fronts because I don’t have a relationship
Topic: Privacy & Security SubTopic: General Tags:
Jan ’26
Reply to Unable to sync SwiftData model fully using CloudKit
The following console log says that your app detected an account switching at the beginning of the launch process, which may erase the existing data created before the switching. It also says that you were using a simulator. CoreData: warning: CoreData+CloudKit: -[PFCloudKitSetupAssistant _checkUserIdentity:]_block_invoke_3(1487): : CKIdentity record has changed from _b09f3f2b1357d21fdd823f58762f6077 to _4e8dc229775b034192825a3081a709a4 error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1242): : Failed to set up CloudKit integration for store: (URL: file:///Users/yuanping_ke/Library/Developer/CoreSimulator/Devices/BA9191E9-6DB4-4A30-9196-0A6C06A11F2E/data/Containers/Data/Application/5977FE0D-50D4-4AE0-8134-5D8B0B662298/Library/Application%20Support/default.store) Later your app did successfully set up CloudKit integration, as shown below, and then did several successful exports and imports, but it seems that there is no change merged into the store. CoreData: warning:
Jan ’26
Reply to @ComputedProperty vs copying values SwiftData AppEntity
A @Property variable is computed when the app entity (AppEntity) is initialized, while a @ComputedProperty variable is computed when the entity is returned. So yes, the SwiftData model can become stale if it changes after the app entity is initialized. Assuming that you have a data controller that manages your SwiftData models, I'd think that you can make the SwiftData model associated with the app entity up to date, so that the getters of your @ComputedProperty variables can return the value directly (without doing a fetch). To ensure the SwiftData model is up to date, you might need to observe the notifications triggered by a store change (basically NSManagedObjectContextObjectsDidChange and .NSPersistentStoreRemoteChange, assuming you are using DefaultStore), check if the change is relevant, and re-fetch the data as needed. If you need more discussion on this topic, feel free to follow up with more details about how your SwiftData store may change, Best, —— Ziqi
Jan ’26
Unable to sync SwiftData model fully using CloudKit
Hey everyone I just ran into an issue where I couldn't sync the model below fully by using CloudKit, enum LinkMapV3_1: VersionedSchema { static let versionIdentifier: Schema.Version = .init(3, 1, 0) static var models: [any PersistentModel.Type] { [AnnotationData.self, GroupData.self, Item.self, Deployment.self, History.self] } // MARK: - Data @Model class AnnotationData { var name: String = var longitude: Double = 0.0 var latitude: Double = 0.0 var order: Int = -1 var level: Int = 1 var detail: String = @Relationship(deleteRule: .nullify, inverse: GroupData.annotation) var groups: [GroupData]? @Relationship(deleteRule: .nullify, inverse: AnnotationData.to) var from: AnnotationData? var to: AnnotationData? var history: History? } // MARK: - History @Model class History { var id: UUID = UUID() var timestamp: Date = Date() @Relationship(deleteRule: .nullify, inverse: AnnotationData.history) var annotations: [AnnotationData]? @Relationship(deleteRule: .nullify, inverse: Group
1
0
300
Jan ’26
Reply to Deleting Production Database SwiftData
Just to add that a code snippet showing how to add multiple SwiftData model configurations to a model container is shown here. Also, this technote talks about how to work with default data. It covers Core Data and hasn't been updated, but the main idea, which I believe is worth mentioning, applies to SwiftData apps as well. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Jan ’26
Reply to Slow rendering List backed by SwiftData @Query
Thanks for mentioning me. The feedback report (FB15507372) @xmollv filed is still under the investigation of the SwiftData team, and we don't have anything ready to share yet. Sorry for no help :-(. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to unifiedContacts identifier vs contactRelations identifier
I provided the source code above for replicating the issue - the GUID for the associated relation has (ahem) no relation to the original record GUIDs. Is someone looking into this - this seems like a bug as what would be the point of not being able to deference the top level record from the relationship.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Using multiple apple-developer-merchantid-domain-association files to support Apple Pay through different payment gateways
Hi @milesg000, Please see my reply to the post you mentioned for the expected behavior: Multiple Apple Pay relationships with differing apple-developer-merchantid-domain-association files https://developer.apple.com/forums/thread/695538?answerId=874306022#874306022 Cheers, Paris X Pinkney |  WWDR | DTS Engineer
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to [FB21797091] Regression: Universal Links/AASA Fetching Fails for IDN on iOS 16+
Thank you for verifying the AASA on Apple's CDN, Albert. Let me clarify the points you raised: 1. URL-Encoded Paths in AASA The URL-encoded characters in the paths are intentional and correct. These represent Japanese text in URL paths: URL-Encoded Decoded (Japanese) Meaning %E3%81%AE%E4%BB%95%E4%BA%8B の仕事 jobs %E9%9A%9C%E3%81%8C%E3%81%84%E8%80%85%E6%8E%A1%E7%94%A8 障がい者採用 disability employment Per RFC 3986, non-ASCII characters in URL paths must be percent-encoded. This is the standard approach for internationalized URLs and should not cause issues with AASA parsing. 2. Relationship Between 求人ボックス.com and xn--pckua2a7gp15o89zb.com These are the same domain: 求人ボックス.com — Unicode/display form (IDN) xn--pckua2a7gp15o89zb.com — Punycode/wire form The AASA is correctly hosted at the Punycode domain (https://xn--pckua2a7gp15o89zb.com/.well-known/apple-app-site-association), and as you confirmed, it is successfully synced to Apple's CDN. 3. The Core Issue Based on swcutil_show.txt, the problem appears to be
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Feb ’26
Reply to Bug? SwiftData + inheritance + optional many-to-one relationship
I encountered another bug with SwiftData and inheritance and reported it (FB21837287). This one is not related to CloudKit. Briefly, SwiftData crashes during auto-save when the schema contains: A base @Model class with at least one subclass (inheritance) A separate @Model class with a reference to the base class The crash occurs specifically when: There is a class inheritance hierarchy (Beta: Alpha) A separate class (Standalone) has a reference typed as the base class (Alpha?) Changing the reference from var ref: Alpha? to var ref: Beta? (subclass) eliminates the crash.
Replies
Boosts
Views
Activity
Feb ’26
Basic introduction to DEXT Matching and Loading
Note: This document is specifically focused on what happens after a DEXT has passed its initial code-signing checks. Code-signing issues are dealt with in other posts. Preliminary Guidance: Using and understanding DriverKit basically requires understanding IOKit, something which isn't entirely clear in our documentation. The good news here is that IOKit actually does have fairly good foundational documentation in the documentation archive. Here are a few of the documents I'd take a look at: IOKit Fundamentals IOKit Device Driver Design Guidelines Accessing Hardware From Applications Special mention to QA1075: Making sense of IOKit error codes,, which I happened to notice today and which documents the IOReturn error format (which is a bit weird on first review). Those documents do not cover the full DEXT loading process, but they are the foundation of how all of this actually works. Understanding the IOKitPersonalities Dictionary The first thing to understand here is that the IOKitPersonalities is called that
Replies
2
Boosts
0
Views
325
Activity
Jan ’26
How to figure out sync errors in Production?
I'm using SwiftData with CloudKit private database. I was able to identify the error on my device by debugging in Xcode with com.apple.CoreData.SQLDebug flag. However, in Production, I couldn't find a way to get the cause of errors. I tried inspecting the error coming from eventChangedNotification. The NSPersistentCloudKitContainer.Event error does not contain any underlying error (neither CKError.userInfo nor in NSError.underlyingError). It only reports a partial failure with CKErrorDomain code 2. If a user encounter an error, there seems to be no way to retrieve the error details. Is there any way to access the error details or logs in Production?
Replies
1
Boosts
0
Views
254
Activity
Jan ’26
Technical Issue: Internal API Version Mismatch (Iris v1 vs. v2) in App Store Connect Game Center Dashboard
Summary There is a critical synchronization issue within the App Store Connect dashboard affecting the management of Game Center Leaderboards. The web interface attempts to perform administrative tasks (such as listing player entries or moderating scores) by calling deprecated or mismatched API endpoints across different versions of the Iris API (v1 and v2), leading to a complete failure of the management UI. I have tried it with multiple browsers (Safari, Mozilla, Chrome, Opera) with same results. Observed Behavior Management UI Failure: The Manage Scores and Players section fails to load, often showing Blocked status in the browser's Network tab or remaining stuck on a loading spinner. API Version Conflict: While some parts of the dashboard successfully fetch app data via /iris/v1/, the leaderboard management logic appears to have been partially migrated to /iris/v2/. This results in the UI making calls to /v1/ resources that return 403 FORBIDDEN (GET_COLLECTION not allowed) or calling /v2/ paths that retur
Replies
0
Boosts
0
Views
102
Activity
Jan ’26
Reply to Bug? SwiftData + inheritance + optional many-to-one relationship
Hello, I am planning a project using SwiftData and inheritance with CloudKit but I am quite concerned about running into this bug. When I click the link to the FB ID above, it comes up empty as do searches for it. Does anyone know the current status?
Replies
Boosts
Views
Activity
Jan ’26
Naming Collision Between Model Attribute and Enum Case in SwiftData and CloudKit
There is a conflict in SwiftData (specifically when synced with CloudKit) when a @Model attribute shares the same name as a case within its assigned enum type. When this occurs, accessing the attribute on a model instance consistently returns the value corresponding to the enum case name, rather than the actual value persisted in the database. Steps to Reproduce Define an enumeration (e.g., Status) with a case that matches a planned property name (e.g., case status). Create a SwiftData @Model that uses this enum. Name the property in the model the same as the enum case. Attempt to save and then retrieve the value. Example Code enum TaskStatus: String, Codable { case status // The conflict source case pending case completed } @Model class TodoItem { // Conflict: Property name matches enum case name var status: TaskStatus init(status: TaskStatus) { self.status = status } } Expected Behavior The property item.status should return the value stored in the database (e.g., .pending or .completed).
Replies
2
Boosts
0
Views
101
Activity
Jan ’26
Reply to evaluatedPolicyDomainState
I’m not sure what sort of help you’re expecting me to provide here. As I mentioned above, this looks like a bug to me. If I had a bug report with a sysdiagnose log, I might — and I want to stress the might here — be able to offer more insight. But without that, I’m flying completely blind. In terms of a workaround, I see two potential options: You could explore user-level workarounds with your user. For example: You might have them reset Face ID (Settings > Face ID & Passcode > Reset Face ID) and re-enroll. Or have them disable the device passcode and then re-enable it. Or have them back up their device and restore from that backup. All of these things are common patterns for clearing out mysterious problems. You could explore code-level workarounds. For example: You might change your system to record multiple biometric domain states. Or have an option to disable biometric domain state checking for specific users. It’s hard to offer specific advice on either of these fronts because I don’t have a relationship
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Jan ’26
Reply to Unable to sync SwiftData model fully using CloudKit
The following console log says that your app detected an account switching at the beginning of the launch process, which may erase the existing data created before the switching. It also says that you were using a simulator. CoreData: warning: CoreData+CloudKit: -[PFCloudKitSetupAssistant _checkUserIdentity:]_block_invoke_3(1487): : CKIdentity record has changed from _b09f3f2b1357d21fdd823f58762f6077 to _4e8dc229775b034192825a3081a709a4 error: CoreData+CloudKit: -[NSCloudKitMirroringDelegate _performSetupRequest:]_block_invoke(1242): : Failed to set up CloudKit integration for store: (URL: file:///Users/yuanping_ke/Library/Developer/CoreSimulator/Devices/BA9191E9-6DB4-4A30-9196-0A6C06A11F2E/data/Containers/Data/Application/5977FE0D-50D4-4AE0-8134-5D8B0B662298/Library/Application%20Support/default.store) Later your app did successfully set up CloudKit integration, as shown below, and then did several successful exports and imports, but it seems that there is no change merged into the store. CoreData: warning:
Replies
Boosts
Views
Activity
Jan ’26
Reply to @ComputedProperty vs copying values SwiftData AppEntity
A @Property variable is computed when the app entity (AppEntity) is initialized, while a @ComputedProperty variable is computed when the entity is returned. So yes, the SwiftData model can become stale if it changes after the app entity is initialized. Assuming that you have a data controller that manages your SwiftData models, I'd think that you can make the SwiftData model associated with the app entity up to date, so that the getters of your @ComputedProperty variables can return the value directly (without doing a fetch). To ensure the SwiftData model is up to date, you might need to observe the notifications triggered by a store change (basically NSManagedObjectContextObjectsDidChange and .NSPersistentStoreRemoteChange, assuming you are using DefaultStore), check if the change is relevant, and re-fetch the data as needed. If you need more discussion on this topic, feel free to follow up with more details about how your SwiftData store may change, Best, —— Ziqi
Replies
Boosts
Views
Activity
Jan ’26
Unable to sync SwiftData model fully using CloudKit
Hey everyone I just ran into an issue where I couldn't sync the model below fully by using CloudKit, enum LinkMapV3_1: VersionedSchema { static let versionIdentifier: Schema.Version = .init(3, 1, 0) static var models: [any PersistentModel.Type] { [AnnotationData.self, GroupData.self, Item.self, Deployment.self, History.self] } // MARK: - Data @Model class AnnotationData { var name: String = var longitude: Double = 0.0 var latitude: Double = 0.0 var order: Int = -1 var level: Int = 1 var detail: String = @Relationship(deleteRule: .nullify, inverse: GroupData.annotation) var groups: [GroupData]? @Relationship(deleteRule: .nullify, inverse: AnnotationData.to) var from: AnnotationData? var to: AnnotationData? var history: History? } // MARK: - History @Model class History { var id: UUID = UUID() var timestamp: Date = Date() @Relationship(deleteRule: .nullify, inverse: AnnotationData.history) var annotations: [AnnotationData]? @Relationship(deleteRule: .nullify, inverse: Group
Replies
1
Boosts
0
Views
300
Activity
Jan ’26
Reply to Deleting Production Database SwiftData
Just to add that a code snippet showing how to add multiple SwiftData model configurations to a model container is shown here. Also, this technote talks about how to work with default data. It covers Core Data and hasn't been updated, but the main idea, which I believe is worth mentioning, applies to SwiftData apps as well. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
Jan ’26