Xcode 13:`'NSPersistentCloudKitContainerOptions' 类型的值没有成员 'databaseScope'`

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

升级到 Xcode 13.0 (13A233) 后,以下代码用于 Xcode 12

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

产生错误:Value of type 'NSPersistentCloudKitContainerOptions' has no member 'databaseScope'

确实,当我点击 NSPersistentCloudKitContainerOptions 时,它显示了没有 databaseScope.

CoreData 框架的旧 (iOS 13) 版本

我的部署目标是iOS 14,它曾经长期使用Xcode 12。此外,它现在在几个项目中被破坏,包括最近使用 Xcode 12 创建的项目。 如何解决这个问题?

显然,现在还需要 import CloudKit 才能使 databaseScopeCoreDataNSPersistentCloudKitContainerOptions class.[=14= 中可用]