Run your app in the Development environment. Then go into the CloudKit Dashboard, switch to Development environment and look for your new attribute there. Then if all is well, deploy it to the Production environment.
It's a file you add from Xcode. New / File / iOS / Resource / App Privacy. After that, you add to it like the below image. I'm using Xcode 15 beta 5 to do this. It's not available with current, non-beta version of Xcode.
My app uses a CloudKit public database and a private database. The image data in the public database is saved as a CKAsset and the data from the downloaded asset is saved in SwiftData. That data is not JSON data. Again, this works well until beta 5.
On visionOS, my app works fine when fetching CKRecords, but crashes when it tries to fetch SwiftData. My app works fine on the iPhone and iPad Simulator.
On visionOS, my app works fine when fetching CKRecords, but crashes when it tries to fetch SwiftData. My app works fine on the iPhone and iPad Simulator.
I converted my Core Data app to SwiftData and here is how the @Model turned out with respect to my image.
@Attribute(.externalStorage) var imageData: Data?
All I had to do was observe the remote change notification within my view controller. I didn't need to turn on remote change notifications.
NotificationCenter.default.addObserver(self,
selector: #selector(updateView(_ :)),
name: .NSPersistentStoreRemoteChange,
object: nil)
Run your app in the Development environment. Then go into the CloudKit Dashboard, switch to Development environment and look for your new attribute there. Then if all is well, deploy it to the Production environment.
It's a file you add from Xcode. New / File / iOS / Resource / App Privacy. After that, you add to it like the below image. I'm using Xcode 15 beta 5 to do this. It's not available with current, non-beta version of Xcode.
My app uses a CloudKit public database and a private database. The image data in the public database is saved as a CKAsset and the data from the downloaded asset is saved in SwiftData. That data is not JSON data. Again, this works well until beta 5.
On visionOS, my app works fine when fetching CKRecords, but crashes when it tries to fetch SwiftData. My app works fine on the iPhone and iPad Simulator.
On visionOS, my app works fine when fetching CKRecords, but crashes when it tries to fetch SwiftData. My app works fine on the iPhone and iPad Simulator.
I converted my Core Data app to SwiftData and here is how the @Model turned out with respect to my image.
@Attribute(.externalStorage) var imageData: Data?
All I had to do was observe the remote change notification within my view controller. I didn't need to turn on remote change notifications.
NotificationCenter.default.addObserver(self,
selector: #selector(updateView(_ :)),
name: .NSPersistentStoreRemoteChange,
object: nil)