Instance Property


The database containing the data shared by all users.


var publicCloudDatabase: CKDatabase { get }


The database in this property is available regardless of whether the user’s device has an active iCloud account. The contents of the public database are readable by all users of the app, and users have write access to the records (and other data objects) they create. Data in the public database is also visible in the developer portal, where you can assign roles to users and restrict access as needed.

Data stored in the public database counts against your app’s iCloud storage quota and not against the quota of any single user.

See Also

Getting the Public and Private Databases

var privateCloudDatabase: CKDatabase

The database containing the user’s private data.

var sharedCloudDatabase: CKDatabase

The database containing shared user data.

func database(with: CKDatabase.Scope) -> CKDatabase

Retrieves the database with the appropriate scope.