Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 13: `Value of type 'NSPersistentCloudKitContainerOptions' has no member 'databaseScope'`

After upgrading to Xcode 13.0 (13A233), the following code that used to work with Xcode 12

let publicOptions = NSPersistentCloudKitContainerOptions(containerIdentifier: containerIdentifier)
publicOptions.databaseScope = .public

produces the error: Value of type 'NSPersistentCloudKitContainerOptions' has no member 'databaseScope'

And indeed when I click on NSPersistentCloudKitContainerOptions it shows the old (iOS 13) version of CoreData framework without databaseScope.

My deployment target is iOS 14 and it used to work with Xcode 12 for a long long time. Also, it is now broken in several projects, including the ones that were created with Xcode 12, i.e. rather recently. How to fix this?

like image 771
Maxim Volgin Avatar asked Oct 22 '25 10:10

Maxim Volgin


1 Answers

Apparently, now it is required to import CloudKit as well to make databaseScope available in CoreData's NSPersistentCloudKitContainerOptions class.

like image 196
Maxim Volgin Avatar answered Oct 25 '25 03:10

Maxim Volgin