Search results for

“SwiftData inheritance relationship”

4,980 results found

Post

Replies

Boosts

Views

Activity

Migrating Sign in with Apple users for an app transfer
Question detail Dear Apple Developer Technical Support, We are currently following the official Apple documentation “TN3159: Migrating Sign in with Apple users for an app transfer” to carry out a Sign in with Apple user migration after successfully transferring several apps to a new developer account. Here is a summary of our situation: Under the original Apple developer account, we had five apps using Sign in with Apple, grouped under a shared primary app using App Grouping. Recently, we transferred three of these apps to our new Apple developer account via App Store Connect. After the transfer, these three apps are no longer associated with the original primary App ID. We reconfigured individual Services IDs for each app in the new account and enabled Sign in with Apple for each. More than 24 hours have passed since the app transfer was completed. Now we are attempting to follow the migration process to restore user access via the user.migration flow. Specifically, we are using the following script to reque
2
0
572
Nov ’25
The relationship between age verification and permission kit isn't clear (IMO)
I'm trying to digest and understand the new set of APIs relating age verification that were released last week. I have say that without some cohesive overview, example app, just a simple diagram showing the relationship of everything, its not at all clear to me what's going on nor what an app developer is expected to do to use these apis (I'm a senior engineer with 15 year's iOS experience, but hey maybe I'm just a bit slow in the head). I have a few questions, but the topic of this post is what is the relationship between age verification i.e. between the declared age range/significant change and Permission Kit? The documentation for the former mentions the Significant Change API/Topic (https://developer.apple.com/news/?id=2ezb6jhj / https://developer.apple.com/documentation/PermissionKit/SignificantAppUpdateTopic). Now the Significant Change Topic is documented as being part of PermissionKit, however the documentation for that (https://developer.apple.com/documentation/permissionkit) State
1
0
216
Nov ’25
Reply to macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS. import SwiftData import SwiftUI struct ContentView: View { @Environment(.modelContext) private var modelContext @Query private var publications: [Publication] @State private var publicationError: EncodedPublicationError? @State private var showErrorAlert = false @State private var selectedTab = 0 var body: some View { NavigationStack { TabView(selection: $selectedTab) { ScrollView { FeaturedView() RecentlyOpenedView() Spacer(minLength: 20) RecentlyUpdatedView() Spacer(minLength: 60) } .tag(0) .tabItem { Label(Home, systemImage: house.fill) } LibraryView() .tag(1) .tabItem { Label(Library, systemImage: books.vertical.fill) } QuestionView() .tag(2) .tabItem { Label(Answers, systemImage: text.bubble.fill) } SearchView() .tag(3) .tabItem { Label(Search, systemImage: magnifyingglass) } } .navigationTitle(navigationTitle) .tabViewStyle(.sidebarAdaptable) .refreshable {
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’25
Reply to SwiftData Versioning with Top-Level Models
If you are making a lightweight migration-able change on a model and the model isn't in a versioned schema (VersionedSchema), that is fine. If you are defining a migration plan, you will need versioned schemas to create migration stages, won't you? Moving models to a schema should be fine, as discussed here. The post was written last year. SwiftData has evolved. If you see anything wrong when trying the method, I'd be interested in taking a closer look. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Nov ’25
SwiftData Versioning with Top-Level Models
If an app is using top-level models, meaning they exist outside the VersionedSchema enum, is it safe to keep them outside of the VersionedSchema enum and use a migration plan for simple migrations. Moving the models within the VersionedSchema enum I believe would change the identity of the models and result in data being lost, although correct me if I'm wrong in that statement. The need presently is just to add another variable to the model and then set that variable within the init function: var updateId = UUID() The app is presently in TestFlight although I'd like to preserve data for users that are currently using the app. The data within SwiftData is synchronized with CloudKit and so I'd also like to avoid any impact to synchronization. Any thoughts on this would be greatly appreciated.
1
0
184
Nov ’25
INQUIRY command is ILLEGAL REQUEST
I am developing a DriverKit driver with the goal of sending vendor-specific commands to a USB storage device. I have successfully created the DriverKit driver, and when I connect the USB storage device, it appears correctly in IORegistryExplorer. My driver class inherits from IOUserSCSIPeripheralDeviceType00 in the SCSIPeripheralsDriverKit framework. I also created a UserClient class that inherits from IOUserClient, and from its ExternalMethod I tried sending an INQUIRY command as a basic test to confirm that command transmission works. However, the device returns an ILLEGAL REQUEST (Sense Key 0x5 / ASC 0x20). Could someone advise what I might be doing wrong? Below are the logs output from the driver: 2025-11-14 21:00:43.573730+0900 0x26e9 Default 0x0 0 0 kernel: (SampleDriverKitApp.SampleDriverKitDriver.dext) [DEBUG] Driver - NewUserClient() - Finished. 2025-11-14 21:00:43.573733+0900 0x26e9 Default 0x0 0 0 kernel: (SampleDriverKitApp.SampleDriverKitDriver.dext) [DEBUG] UserClient - Start()
1
0
329
Nov ’25
PhotosPickerItem.itemIdentifier always nil
I'm using the SwiftUI Photos Picker to select videos from the users Photos library and then opening the video using the PhotosPickerItem. I'm looking for a way to allow the user to open the same video on their other devices as the app uses SwiftData and CloudKit to provide access to a recently watched list of videos. The URL from the PhotosPickerItem appears to be device specific and so I was looking to see if I can use the itemIdentifier and then the init that takes the itemIdentifier to create the PhotosPickerItem on the other devices. The itemIdentifier however is always nil and so wouldn't be able to be used in this way. Is there an alternative approach whereby the users can open a video using a PhotosPickerItem and that item would be viewable on their other devices with an item identifier or a URL that is device agnostic. This approach should also not involve copying the video into other storage as it would simply expand the use of the users iCloud storage, providing a less than ideal user exper
1
0
689
Nov ’25
NSButton + TtGC6AppKit18_NSCoreHostingViewVS_12AppKitButton - Image Alignment Changed/Broken in Minor macOS 26.1 Update
I just updated to macOS 26.1. I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get). I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols. With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things. Additio
1
0
105
Nov ’25
Reply to Why can’t sandboxed mac app store apps have full disk access available in the system settings for full disk access?
You’re conflating a bunch of different things here. [quote='807142021, andyt, /thread/807142, /profile/andyt'] I discovered mac app store apps in release mode cannot access … other command line programs [/quote] First up, terminology. When we talk about Debug and Release mode, those are build configurations. That’s technically independent from Development and Distribution code signing. While it’s common for folks to combine the Debug build configuration with Development signing, that’s not required. In fact, sometimes it’s useful to mix these up. I explain one such case in Isolating Code Signing Problems from Build Problems. None of that’s related your actual issue though. Rather, App Store apps must enable the App Sandbox, and that limits the app’s ability to access the file system. And specifically, when it comes to executables: If a sandboxed app spawns a child process, that process inherits the app’s static sandbox. Many command-line tools don’t work when sandboxed. A sandboxed app can only run e
Topic: Privacy & Security SubTopic: General Tags:
Nov ’25
Impossible to select a build without an App Clip
A few months ago I tested App Clips with my app, but I don't plan to add them for now. The problem is that now I can't select a build in App Store Connect that does not contain an App Clip, and I receive the following error: An error has occurred. Try again later. I've inspected the HTTP response to get more information about the error, and I got this: { errors : [ { id : xxxxxxxxxxxxxxxxxxxxxxxx, status : 409, code : ENTITY_ERROR.RELATIONSHIP.UNKNOWN, title : The provided entity includes an unknown relationship, detail : 'appClipDefaultExperiences' is not a relationship on the resource 'appStoreVersions', source : { pointer : /data/relationships/appClipDefaultExperiences } } ] } Does anybody know how to completely disable App Clips for one app without having to generate a new identifier? Thank you so much and have a great day/night! Aniol.
1
0
815
Nov ’25
Reply to Strange behavior with 100k+ records in NSPersistentCloudKitContainer
I’m having a similar problem. I found a reddit post about this issue where the author writes, “I’m guessing it only shows up for devs who bulk import/delete during testing, while normal users with a few hundred records never notice.” Which makes sense because I am also bulk importing. I’m seeing about a 6-8 times increase between the local storage and CloudKit. (Specifically, 15k records comes out to around 13mb of local storage, but 100mb with CloudKit enabled. ANSCKRECORDMETADATA appears to be the main culprit.) I’m making a flashcard app, and of course users can import as many cards as they want, which could become a storage problem pretty quickly. From my understanding, and as you mentioned, a storage increase is expected. But the increase I’m seeing just seems excessive. … Or is it? I can’t really find anything on what to expect. I wonder if there’s something I can change in the model to make this work. Or maybe the problem is unique to NSPersistentCloudKitContainer and I should look at other sync option
Nov ’25
How to correctly fetch data using SwiftData
Hi there! I'm making an app that stores data for the user's profile in SwiftData. I was originally going to use UserDefaults but I thought SwiftData could save Images natively but this is not true so I really could switch back to UserDefaults and save images as Data but I'd like to try to get this to work first. So essentially I have textfields and I save the values of them through a class allProfileData. Here's the code for that: import SwiftData import SwiftUI @Model class allProfileData { var profileImageData: Data? var email: String var bio: String var username: String var profileImage: Image { if let data = profileImageData, let uiImage = UIImage(data: data) { return Image(uiImage: uiImage) } else { return Image(DefaultProfile) } } init(email:String, profileImageData: Data?, bio: String, username:String) { self.profileImageData = profileImageData self.email = email self.bio = bio self.username = username } } To save this I create a new class (I think, I'm new) and save it throu
7
0
338
Nov ’25
App crashes due to a third-party library we use making a bad memory access.
Is there a way to prevent or handle our application's crash if a third-party library makes a bad memory access? Basically, I want to know if using a buggy library (that causes bad memory access) will automatically make our application inherit those crashes, leading to our app crashing as well. If there is a way to prevent the crash, what methods can be used to do so? Thread 13: EXC_BAD_ACCESS (code=1, address=0x3a7d300)
2
0
233
Nov ’25
Reply to Provider entitlements check failed
Before I file a bug report, does the Info.plist need an entry that matches the entitlement? Sort of. The exact behavior here is going to depend on exactly what you're matching, but the typical configuration is that your Info.plist and entitlement configuration would both define IOPCIPrimaryMatch but they wouldn't necessarily be identical. In the case of the dev only entitlement they'd basically never be identical, since the dev entitlement matches everything. For reference, the configuration of the DEXT I tested the entitlement with is: Info.plist: ... IOPCIPrimaryMatch = 0x400014e4&0xf000ffff ... However, going over the details again, I do have one minor correction. Above I said that the Entitlement.plist value should be 0xFFFFFFFF&0x00000000, however, that's wrong. That's the value that's embedded in the provisioning profile, which escapes the &. The Entitlement.plist uses the & directly, so the correct value is actually: Entitlement.plist: ... com.apple.developer.driverkit.transport.pci I
Topic: App & System Services SubTopic: Drivers Tags:
Nov ’25
Migrating Sign in with Apple users for an app transfer
Question detail Dear Apple Developer Technical Support, We are currently following the official Apple documentation “TN3159: Migrating Sign in with Apple users for an app transfer” to carry out a Sign in with Apple user migration after successfully transferring several apps to a new developer account. Here is a summary of our situation: Under the original Apple developer account, we had five apps using Sign in with Apple, grouped under a shared primary app using App Grouping. Recently, we transferred three of these apps to our new Apple developer account via App Store Connect. After the transfer, these three apps are no longer associated with the original primary App ID. We reconfigured individual Services IDs for each app in the new account and enabled Sign in with Apple for each. More than 24 hours have passed since the app transfer was completed. Now we are attempting to follow the migration process to restore user access via the user.migration flow. Specifically, we are using the following script to reque
Replies
2
Boosts
0
Views
572
Activity
Nov ’25
The relationship between age verification and permission kit isn't clear (IMO)
I'm trying to digest and understand the new set of APIs relating age verification that were released last week. I have say that without some cohesive overview, example app, just a simple diagram showing the relationship of everything, its not at all clear to me what's going on nor what an app developer is expected to do to use these apis (I'm a senior engineer with 15 year's iOS experience, but hey maybe I'm just a bit slow in the head). I have a few questions, but the topic of this post is what is the relationship between age verification i.e. between the declared age range/significant change and Permission Kit? The documentation for the former mentions the Significant Change API/Topic (https://developer.apple.com/news/?id=2ezb6jhj / https://developer.apple.com/documentation/PermissionKit/SignificantAppUpdateTopic). Now the Significant Change Topic is documented as being part of PermissionKit, however the documentation for that (https://developer.apple.com/documentation/permissionkit) State
Replies
1
Boosts
0
Views
216
Activity
Nov ’25
Reply to macOS 26: retain cycle detected when navigation link label contains a Swift Chart
I'm also experiencing this issue, but I'm not using Charts. It's when navigating back to my Home tab on macOS only. This works fine on iOS. import SwiftData import SwiftUI struct ContentView: View { @Environment(.modelContext) private var modelContext @Query private var publications: [Publication] @State private var publicationError: EncodedPublicationError? @State private var showErrorAlert = false @State private var selectedTab = 0 var body: some View { NavigationStack { TabView(selection: $selectedTab) { ScrollView { FeaturedView() RecentlyOpenedView() Spacer(minLength: 20) RecentlyUpdatedView() Spacer(minLength: 60) } .tag(0) .tabItem { Label(Home, systemImage: house.fill) } LibraryView() .tag(1) .tabItem { Label(Library, systemImage: books.vertical.fill) } QuestionView() .tag(2) .tabItem { Label(Answers, systemImage: text.bubble.fill) } SearchView() .tag(3) .tabItem { Label(Search, systemImage: magnifyingglass) } } .navigationTitle(navigationTitle) .tabViewStyle(.sidebarAdaptable) .refreshable {
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’25
Reply to SwiftData Versioning with Top-Level Models
If you are making a lightweight migration-able change on a model and the model isn't in a versioned schema (VersionedSchema), that is fine. If you are defining a migration plan, you will need versioned schemas to create migration stages, won't you? Moving models to a schema should be fine, as discussed here. The post was written last year. SwiftData has evolved. If you see anything wrong when trying the method, I'd be interested in taking a closer look. Best, —— Ziqiao Chen  Worldwide Developer Relations.
Replies
Boosts
Views
Activity
Nov ’25
SwiftData Versioning with Top-Level Models
If an app is using top-level models, meaning they exist outside the VersionedSchema enum, is it safe to keep them outside of the VersionedSchema enum and use a migration plan for simple migrations. Moving the models within the VersionedSchema enum I believe would change the identity of the models and result in data being lost, although correct me if I'm wrong in that statement. The need presently is just to add another variable to the model and then set that variable within the init function: var updateId = UUID() The app is presently in TestFlight although I'd like to preserve data for users that are currently using the app. The data within SwiftData is synchronized with CloudKit and so I'd also like to avoid any impact to synchronization. Any thoughts on this would be greatly appreciated.
Replies
1
Boosts
0
Views
184
Activity
Nov ’25
INQUIRY command is ILLEGAL REQUEST
I am developing a DriverKit driver with the goal of sending vendor-specific commands to a USB storage device. I have successfully created the DriverKit driver, and when I connect the USB storage device, it appears correctly in IORegistryExplorer. My driver class inherits from IOUserSCSIPeripheralDeviceType00 in the SCSIPeripheralsDriverKit framework. I also created a UserClient class that inherits from IOUserClient, and from its ExternalMethod I tried sending an INQUIRY command as a basic test to confirm that command transmission works. However, the device returns an ILLEGAL REQUEST (Sense Key 0x5 / ASC 0x20). Could someone advise what I might be doing wrong? Below are the logs output from the driver: 2025-11-14 21:00:43.573730+0900 0x26e9 Default 0x0 0 0 kernel: (SampleDriverKitApp.SampleDriverKitDriver.dext) [DEBUG] Driver - NewUserClient() - Finished. 2025-11-14 21:00:43.573733+0900 0x26e9 Default 0x0 0 0 kernel: (SampleDriverKitApp.SampleDriverKitDriver.dext) [DEBUG] UserClient - Start()
Replies
1
Boosts
0
Views
329
Activity
Nov ’25
PhotosPickerItem.itemIdentifier always nil
I'm using the SwiftUI Photos Picker to select videos from the users Photos library and then opening the video using the PhotosPickerItem. I'm looking for a way to allow the user to open the same video on their other devices as the app uses SwiftData and CloudKit to provide access to a recently watched list of videos. The URL from the PhotosPickerItem appears to be device specific and so I was looking to see if I can use the itemIdentifier and then the init that takes the itemIdentifier to create the PhotosPickerItem on the other devices. The itemIdentifier however is always nil and so wouldn't be able to be used in this way. Is there an alternative approach whereby the users can open a video using a PhotosPickerItem and that item would be viewable on their other devices with an item identifier or a URL that is device agnostic. This approach should also not involve copying the video into other storage as it would simply expand the use of the users iCloud storage, providing a less than ideal user exper
Replies
1
Boosts
0
Views
689
Activity
Nov ’25
NSButton + TtGC6AppKit18_NSCoreHostingViewVS_12AppKitButton - Image Alignment Changed/Broken in Minor macOS 26.1 Update
I just updated to macOS 26.1. I have a pure AppKit app (I guess that's not possible anymore but as close to a pure AppKit app as you can get). I use NSButton with the glass bezel style and SF symbol images. It looks like the minor OS update brought layout changes because now some of these buttons are scaling the symbol image much larger than was being done on macOS 26. The image can sometimes draw outside the glass 'bezel'. It looks like using the 'info' symbol in a button results in much larger image scaling than it did on the previous Tahoe for some SF Symbols. With the glass bezel style and a SF Symbol image how am I supposed to consistently make the button look good? With certain symbols I have to use imageScaling NSImageScaleProportionallyUpOrDown and on others I have to use NSImageScaleProportionallyDown. If I'm using a system image shouldn't it just do the right thing? Is trial and error the only way to tell? That's what I was doing before but it seems that the minor 26.1 update changed things. Additio
Replies
1
Boosts
0
Views
105
Activity
Nov ’25
Reply to Why can’t sandboxed mac app store apps have full disk access available in the system settings for full disk access?
You’re conflating a bunch of different things here. [quote='807142021, andyt, /thread/807142, /profile/andyt'] I discovered mac app store apps in release mode cannot access … other command line programs [/quote] First up, terminology. When we talk about Debug and Release mode, those are build configurations. That’s technically independent from Development and Distribution code signing. While it’s common for folks to combine the Debug build configuration with Development signing, that’s not required. In fact, sometimes it’s useful to mix these up. I explain one such case in Isolating Code Signing Problems from Build Problems. None of that’s related your actual issue though. Rather, App Store apps must enable the App Sandbox, and that limits the app’s ability to access the file system. And specifically, when it comes to executables: If a sandboxed app spawns a child process, that process inherits the app’s static sandbox. Many command-line tools don’t work when sandboxed. A sandboxed app can only run e
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’25
Impossible to select a build without an App Clip
A few months ago I tested App Clips with my app, but I don't plan to add them for now. The problem is that now I can't select a build in App Store Connect that does not contain an App Clip, and I receive the following error: An error has occurred. Try again later. I've inspected the HTTP response to get more information about the error, and I got this: { errors : [ { id : xxxxxxxxxxxxxxxxxxxxxxxx, status : 409, code : ENTITY_ERROR.RELATIONSHIP.UNKNOWN, title : The provided entity includes an unknown relationship, detail : 'appClipDefaultExperiences' is not a relationship on the resource 'appStoreVersions', source : { pointer : /data/relationships/appClipDefaultExperiences } } ] } Does anybody know how to completely disable App Clips for one app without having to generate a new identifier? Thank you so much and have a great day/night! Aniol.
Replies
1
Boosts
0
Views
815
Activity
Nov ’25
Reply to Strange behavior with 100k+ records in NSPersistentCloudKitContainer
I’m having a similar problem. I found a reddit post about this issue where the author writes, “I’m guessing it only shows up for devs who bulk import/delete during testing, while normal users with a few hundred records never notice.” Which makes sense because I am also bulk importing. I’m seeing about a 6-8 times increase between the local storage and CloudKit. (Specifically, 15k records comes out to around 13mb of local storage, but 100mb with CloudKit enabled. ANSCKRECORDMETADATA appears to be the main culprit.) I’m making a flashcard app, and of course users can import as many cards as they want, which could become a storage problem pretty quickly. From my understanding, and as you mentioned, a storage increase is expected. But the increase I’m seeing just seems excessive. … Or is it? I can’t really find anything on what to expect. I wonder if there’s something I can change in the model to make this work. Or maybe the problem is unique to NSPersistentCloudKitContainer and I should look at other sync option
Replies
Boosts
Views
Activity
Nov ’25
How to correctly fetch data using SwiftData
Hi there! I'm making an app that stores data for the user's profile in SwiftData. I was originally going to use UserDefaults but I thought SwiftData could save Images natively but this is not true so I really could switch back to UserDefaults and save images as Data but I'd like to try to get this to work first. So essentially I have textfields and I save the values of them through a class allProfileData. Here's the code for that: import SwiftData import SwiftUI @Model class allProfileData { var profileImageData: Data? var email: String var bio: String var username: String var profileImage: Image { if let data = profileImageData, let uiImage = UIImage(data: data) { return Image(uiImage: uiImage) } else { return Image(DefaultProfile) } } init(email:String, profileImageData: Data?, bio: String, username:String) { self.profileImageData = profileImageData self.email = email self.bio = bio self.username = username } } To save this I create a new class (I think, I'm new) and save it throu
Replies
7
Boosts
0
Views
338
Activity
Nov ’25
App crashes due to a third-party library we use making a bad memory access.
Is there a way to prevent or handle our application's crash if a third-party library makes a bad memory access? Basically, I want to know if using a buggy library (that causes bad memory access) will automatically make our application inherit those crashes, leading to our app crashing as well. If there is a way to prevent the crash, what methods can be used to do so? Thread 13: EXC_BAD_ACCESS (code=1, address=0x3a7d300)
Replies
2
Boosts
0
Views
233
Activity
Nov ’25
Reply to Provider entitlements check failed
Before I file a bug report, does the Info.plist need an entry that matches the entitlement? Sort of. The exact behavior here is going to depend on exactly what you're matching, but the typical configuration is that your Info.plist and entitlement configuration would both define IOPCIPrimaryMatch but they wouldn't necessarily be identical. In the case of the dev only entitlement they'd basically never be identical, since the dev entitlement matches everything. For reference, the configuration of the DEXT I tested the entitlement with is: Info.plist: ... IOPCIPrimaryMatch = 0x400014e4&0xf000ffff ... However, going over the details again, I do have one minor correction. Above I said that the Entitlement.plist value should be 0xFFFFFFFF&0x00000000, however, that's wrong. That's the value that's embedded in the provisioning profile, which escapes the &. The Entitlement.plist uses the & directly, so the correct value is actually: Entitlement.plist: ... com.apple.developer.driverkit.transport.pci I
Topic: App & System Services SubTopic: Drivers Tags:
Replies
Boosts
Views
Activity
Nov ’25
Reply to How to correctly fetch data using SwiftData
Sorry got confused with all the code. import SwiftUI import SwiftData @main struct fbla_appApp: App { var body: some Scene { WindowGroup { ContentView() } .modelContainer(for: allProfileData.self) } }
Topic: UI Frameworks SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’25