Initializes the CloudKit sharing controller with a preparation handler intending to save a new share record.
- iOS 10.0+
- Mac Catalyst 13.0+Beta
init(preparation initializer method to create a new
UICloud instance when the user who owns a
CKRecord wants to share the record with other people. To determine if the record is shared, check its
share property. If the property value is
nil, the record is not shared, and this method is the one to use.
preparation provided to the initializer method is responsible for saving the new
CKShare record. The handler has two parameters:
A reference to the
UICloudinstance that called the preparation handler
A reference to a completion block
After you save the new
CKShare record and its root record (the
CKRecord representing the data to share) in the preparation handler, you call the completion block. Calling the completion block tells the
UICloud instance to continue with the invitation workflow.
For more information and sample code, see Inviting Participants to a New Share.