Is there a way to use SwiftData without automatic iCloud sync? I’d like to do that manually using my own CloudKit solution or CKSyncEngine. SwiftData automatically picks up any CloudKit containers though and I have not seen an option to disable this behavior. Setting cloudKitContainerIdentifier to nil does still pick the first available CloudKit container.
Just in case this is a bug: FB12276416
Sample:
let configuration = ModelConfiguration(cloudKitContainerIdentifier: nil)
let modelContainer = try! ModelContainer(for: [GamesCollection.self], configuration)
print(modelContainer.configurations)
// [SwiftData.ModelConfiguration(url: …, name: …, sharedAppContainerIdentifier: …, cloudKitContainerIdentifier: Optional("iCloud.CloudKit.com.+++")