init
TypeScriptstatic init(containerIdentifier: string): CKContainerSwift declarationinit(identifier containerIdentifier: String)class · iOS 8.0+ · SDK 27.1
class CKContainerstatic init(containerIdentifier: string): CKContainerSwift declarationinit(identifier containerIdentifier: String)static default(): CKContainerSwift declarationclass func `default`() -> CKContaineracceptCompletionHandler(metadata: CKShare_Metadata, completionHandler: ((arg0: (CKShare) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc accept(_ metadata: CKShare.Metadata, completionHandler: @escaping @Sendable (CKShare?, (any Error)?) -> Void)accountStatus(completionHandler: ((arg0: CKAccountStatus, arg1: (NativeError) | null) => void)): voidSwift declarationfunc accountStatus() async throws -> CKAccountStatusadd(operation: CKOperation): voidSwift declarationfunc add(_ operation: CKOperation)database(databaseScope: CKDatabase_Scope): CKDatabaseSwift declarationfunc database(with databaseScope: CKDatabase.Scope) -> CKDatabasediscoverAllIdentities(completionHandler: ((arg0: (Array<CKUserIdentity>) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc discoverAllIdentities(completionHandler: @escaping @Sendable ([CKUserIdentity]?, (any Error)?) -> Void)discoverUserIdentityWithEmailAddressCompletionHandler(email: string, completionHandler: ((arg0: (CKUserIdentity) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc discoverUserIdentity(withEmailAddress email: String, completionHandler: @escaping @Sendable (CKUserIdentity?, (any Error)?) -> Void)discoverUserIdentityWithPhoneNumberCompletionHandler(phoneNumber: string, completionHandler: ((arg0: (CKUserIdentity) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc discoverUserIdentity(withPhoneNumber phoneNumber: String, completionHandler: @escaping @Sendable (CKUserIdentity?, (any Error)?) -> Void)discoverUserIdentityWithUserRecordIDCompletionHandler(userRecordID: CKRecord_ID, completionHandler: ((arg0: (CKUserIdentity) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc discoverUserIdentity(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping @Sendable (CKUserIdentity?, (any Error)?) -> Void)fetchShareMetadata(url: string, completionHandler: ((arg0: (CKShare_Metadata) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fetchShareMetadata(with url: URL, completionHandler: @escaping @Sendable (CKShare.Metadata?, (any Error)?) -> Void)fetchShareParticipantWithEmailAddressCompletionHandler(emailAddress: string, completionHandler: ((arg0: (CKShare_Participant) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fetchShareParticipant(withEmailAddress emailAddress: String, completionHandler: @escaping @Sendable (CKShare.Participant?, (any Error)?) -> Void)fetchShareParticipantWithPhoneNumberCompletionHandler(phoneNumber: string, completionHandler: ((arg0: (CKShare_Participant) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fetchShareParticipant(withPhoneNumber phoneNumber: String, completionHandler: @escaping @Sendable (CKShare.Participant?, (any Error)?) -> Void)fetchShareParticipantWithUserRecordIDCompletionHandler(userRecordID: CKRecord_ID, completionHandler: ((arg0: (CKShare_Participant) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc fetchShareParticipant(withUserRecordID userRecordID: CKRecord.ID, completionHandler: @escaping @Sendable (CKShare.Participant?, (any Error)?) -> Void)fetchUserRecordID(completionHandler: ((arg0: (CKRecord_ID) | null, arg1: (NativeError) | null) => void)): voidSwift declarationfunc userRecordID() async throws -> CKRecord.IDrequestApplicationPermission(applicationPermission: CKContainer_ApplicationPermissions, completionHandler: ((arg0: CKContainer_ApplicationPermissionStatus, arg1: (NativeError) | null) => void)): voidSwift declarationfunc requestApplicationPermission(_ applicationPermission: CKContainer.ApplicationPermissions) async throws -> CKContainer.ApplicationPermissionStatusstatus(applicationPermission: CKContainer_ApplicationPermissions, completionHandler: ((arg0: CKContainer_ApplicationPermissionStatus, arg1: (NativeError) | null) => void)): voidSwift declarationfunc applicationPermissionStatus(for applicationPermission: CKContainer.ApplicationPermissions) async throws -> CKContainer.ApplicationPermissionStatusget containerIdentifier(): (string) | nullSwift declarationvar containerIdentifier: String? { get }get privateCloudDatabase(): CKDatabaseSwift declarationvar privateCloudDatabase: CKDatabase { get }get publicCloudDatabase(): CKDatabaseSwift declarationvar publicCloudDatabase: CKDatabase { get }get sharedCloudDatabase(): CKDatabaseSwift declarationvar sharedCloudDatabase: CKDatabase { get }userIdentityForPhoneNumber(phoneNumber: string): Promise<(CKUserIdentity) | null>Swift declarationfunc userIdentity(forPhoneNumber phoneNumber: String) async throws -> CKUserIdentity?Fetches the user identity for the specified phone number. - Parameters: - phoneNumber: The user's phone number. - Returns: The user identity for the phone number. Use this method to retrieve the identity of a user who the current user knows. The user you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for the user asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
userIdentityForEmailAddress(email: string): Promise<(CKUserIdentity) | null>Swift declarationfunc userIdentity(forEmailAddress email: String) async throws -> CKUserIdentity?Fetches the user identity for the specified email address. - Parameters: - email: The user's email address. - Returns: The user identity for the email address. Use this method to retrieve the identity of a user who the current user knows. The user you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for the user asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
userIdentityForUserRecordID(userRecordID: CKRecord_ID): Promise<(CKUserIdentity) | null>Swift declarationfunc userIdentity(forUserRecordID userRecordID: CKRecord.ID) async throws -> CKUserIdentity?Fetches the user identity for the specified user record ID. - Parameters: - userRecordID: The user record's ID. - Returns: The user identity for the user record ID. Use this method to retrieve the identity of a user who you already have a user record ID for. The user you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for the user asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
shareMetadata(url: string): Promise<CKShare_Metadata>Swift declarationfunc shareMetadata(for url: URL) async throws -> CKShare.MetadataFetches the share metadata for the specified share URL. - Parameters: - url: The share URL that CloudKit uses to locate the metadata. - Returns: The share metadata for the share URL.
configuredWithConfigurationGroupBody(configuration: (CKOperation_Configuration) | null, group: (CKOperationGroup) | null, body: ((arg0: CKContainer) => unknown)): unknownSwift declaration@discardableResult func configuredWith<R>(configuration: CKOperation.Configuration? = nil, group: CKOperationGroup? = nil, body: (CKContainer) throws -> R) rethrows -> RApplies a temporary configuration to the container within the scope of a closure. - Parameters: - configuration: An interim configuration to apply to the current container. - group: The group to associate with the methods you execute in the closure. Specifying a group helps the system prioritize those method calls, and helps you identify the calls in the server logs in CloudKit Console. For more information, see ``CKOperationGroup``. - body: The closure to execute with the temporarily configured container. Use this method to apply a specific configuration to the current container that lasts only for the duration of the trailing closure. For example, you might want to temporarily elevate the quality of service (QoS) for a group of method calls, or allow one or more expensive method calls to execute only while the device is using WiFi. ```swift func fetchShareParticipants( with phoneNumbers: [String], completionHandler: @escaping ( Result<[String : Result<CKShare.Participant, any Error>], any Error> ) -> Void ) { // Get a reference to the app's container. let container = CKContainer.default() // Create a configuration that denies cellular access. let config = CKOperation.Configuration() config.allowsCellularAccess = false // Configure the container and execute an expensive fetch. container.configuredWith(configuration: config) { container in container.fetchShareParticipants(forPhoneNumbers: phoneNumbers, completionHandler: completionHandler) } } ```
configuredWithConfigurationGroupBody21466(configuration: (CKOperation_Configuration) | null, group: (CKOperationGroup) | null, body: ((arg0: CKContainer) => Promise<unknown>)): Promise<unknown>Swift declaration@discardableResult @preconcurrency func configuredWith<R>(configuration: CKOperation.Configuration? = nil, group: CKOperationGroup? = nil, body: @Sendable (CKContainer) async throws -> R) async rethrows -> RApplies a temporary configuration to the container within the scope of a closure that supports concurrency. - Parameters: - configuration: An interim configuration to apply to the current container. - group: The group to associate with the methods you execute in the closure. Specifying a group helps the system prioritize those method calls, and helps you identify the calls in the server logs in CloudKit Console. For more information, see ``CKOperationGroup``. - body: The closure to execute with the temporarily configured container. Use this method to apply a specific configuration to the current container that lasts only for the duration of the trailing closure. For example, you might want to temporarily elevate the quality of service (QoS) for a group of method calls, or allow one or more expensive method calls to execute only while the device is using WiFi. ```swift func fetchShareParticipants( with phoneNumbers: [String] ) async throws -> [String : Result<CKShare.Participant, any Error>] { // Get a reference to the app's container. let container = CKContainer.default() // Create a configuration that denies cellular access. let config = CKOperation.Configuration() config.allowsCellularAccess = false // Configure the container and execute an expensive fetch. return try await container.configuredWith(configuration: config) { container in try await container.shareParticipants(forPhoneNumbers: phoneNumbers) } } ```
shareMetadatas(urls: Array<string>): Promise<Record<string, SDKHandle>>Swift declarationfunc shareMetadatas(for urls: [URL]) async throws -> [URL : Result<CKShare.Metadata, any Error>]Fetches share metadatas for the specified share URLs and returns them to an awaiting caller. - Parameters: - urls: The share URLs that CloudKit uses to locate the metadatas. - Returns: A dictionary of fetched share metadatas. The dictionary uses the URLs you specify in `urls` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share metadata, or an error that describes why CloudKit can't fetch that share metadata. This method searches for share metadatas asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareMetadataOperation`` and configure it to use the necessary priority.
userIdentitiesForPhoneNumbers(phoneNumbers: Array<string>): Promise<Record<string, CKUserIdentity>>Swift declarationfunc userIdentities(forPhoneNumbers phoneNumbers: [String]) async throws -> [String : CKUserIdentity]Fetches the user identities for the specified phone numbers and returns them to an awaiting caller. - Parameters: - phoneNumbers: The users' phone numbers. - Returns: A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the phone numbers. In the successful case, the dictionary uses the phone numbers you specify in `phoneNumbers` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
userIdentitiesForUserRecordIDs(userRecordIDs: Array<CKRecord_ID>): Promise<NativeMap<CKRecord_ID, CKUserIdentity>>Swift declarationfunc userIdentities(forUserRecordIDs userRecordIDs: [CKRecord.ID]) async throws -> [CKRecord.ID : CKUserIdentity]Fetches the user identities for the specified user record IDs and returns them to an awaiting caller. - Parameters: - userRecordIDs: The users' user record IDs. - Returns: A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the user record IDs. In the successful case, the dictionary uses the user record IDs you specify in `userRecordIDs` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
userIdentitiesForEmailAddresses(emails: Array<string>): Promise<Record<string, CKUserIdentity>>Swift declarationfunc userIdentities(forEmailAddresses emails: [String]) async throws -> [String : CKUserIdentity]Fetches the user identities for the specified email addresses and returns them to an awaiting caller. - Parameters: - emails: The users' email addresses. - Returns: A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the email addresses. In the successful case, the dictionary uses the email addresses you specify in `emails` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
shareParticipantForPhoneNumber(phoneNumber: string): Promise<CKShare_Participant>Swift declarationfunc shareParticipant(forPhoneNumber phoneNumber: String) async throws -> CKShare.ParticipantFetches the share participant with the specified phone number. - Parameters: - phoneNumber: The share participant's phone number. - Returns: The share participant for the phone number. CloudKit can translate any valid phone number into a share participant. If the phone number doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the phone number to an iCloud account. This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantForEmailAddress(email: string): Promise<CKShare_Participant>Swift declarationfunc shareParticipant(forEmailAddress email: String) async throws -> CKShare.ParticipantFetches the share participant with the specified email address. - Parameters: - emailAddress: The share participant's email address. - Returns: The share participant for the email address. CloudKit can translate any valid email address into a share participant. If the email address doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the email address to an iCloud account. This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantForUserRecordID(userRecordID: CKRecord_ID): Promise<CKShare_Participant>Swift declarationfunc shareParticipant(forUserRecordID userRecordID: CKRecord.ID) async throws -> CKShare.ParticipantFetches the share participant with the specified user record ID. - Parameters: - userRecordID: The share participant's user record ID. - Returns: The share participant for the user record ID. This method searches for the share participant asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantsForPhoneNumbers(phoneNumbers: Array<string>): Promise<Record<string, SDKHandle>>Swift declarationfunc shareParticipants(forPhoneNumbers phoneNumbers: [String]) async throws -> [String : Result<CKShare.Participant, any Error>]Fetches share participants with the specified phone numbers and returns them to an awaiting caller. - Parameters: - phoneNumbers: The share participants' phone numbers. - Returns: A dictionary of fetched share participants. The dictionary uses the phone numbers you specify in `phoneNumbers` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. CloudKit can translate any valid phone number into a share participant. If the phone number doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the phone number to an iCloud account. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantsForUserRecordIDs(userRecordIDs: Array<CKRecord_ID>): Promise<NativeMap<CKRecord_ID, SDKHandle>>Swift declarationfunc shareParticipants(forUserRecordIDs userRecordIDs: [CKRecord.ID]) async throws -> [CKRecord.ID : Result<CKShare.Participant, any Error>]Fetches share participants with the specified user record IDs and returns them to an awaiting caller. - Parameters: - userRecordIDs: The share participants' user record IDs. - Returns: A dictionary of fetched share participants. The dictionary uses the user record IDs you specify in `userRecordIDs` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantsForEmailAddresses(emails: Array<string>): Promise<Record<string, SDKHandle>>Swift declarationfunc shareParticipants(forEmailAddresses emails: [String]) async throws -> [String : Result<CKShare.Participant, any Error>]Fetches share participants with the specified email addresses and returns them to an awaiting caller. - Parameters: - emails: The share participants' email addresses. - Returns: A dictionary of fetched share participants. The dictionary uses the email addresses you specify in `emails` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. CloudKit can translate any valid email address into a share participant. If the email address doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the email address to an iCloud account. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
shareParticipantsFor(lookupInfos: Array<CKUserIdentity_LookupInfo>): Promise<NativeMap<CKUserIdentity_LookupInfo, SDKHandle>>Swift declarationfunc shareParticipants(for lookupInfos: [CKUserIdentity.LookupInfo]) async throws -> [CKUserIdentity.LookupInfo : Result<CKShare.Participant, any Error>]Fetches share participants with the specified lookup infos and returns them to an awaiting caller. - Parameters: - lookupInfos: The share participants' lookup infos. - Returns: A dictionary of fetched share participants. The dictionary uses the lookup infos you specify in `lookupInfos` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
longLivedOperation(operationID: string): Promise<(CKOperation) | null>Swift declarationfunc longLivedOperation(for operationID: CKOperation.ID) async throws -> CKOperation?Fetches the long-lived operation for the specified operation ID and returns it to an awaiting caller. - Parameters: - operationID: The operation's ID. - Returns: The long-lived operation, or `nil` if the operation completes, or your app or the system cancels it A long-lived operation is one that continues to run after the user closes your app. When a long-lived operation completes, the system calls its completion block to notify you. After setting callback blocks on the returned long-lived operation, and starting the returned long-lived operation on an operation queue, the operation invokes all callbacks made while your app was closed.
requestShareAccess(urls: Array<string>): Promise<Record<string, SDKHandle>>Swift declarationfunc requestShareAccess(for urls: [URL]) async throws -> [URL : Result<Void, any Error>]Requests access to the specified share URLs, and returns the results to an awaiting caller. - Parameters: - urls: The share URLs that CloudKit uses to locate the shares. - Returns: A dictionary of acceptance results. The dictionary uses the urls you specify in `urls` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result>: `.success(())` when CloudKit grants access to that share, or an error that describes why CloudKit can't request access to that share. This method requests access to shares asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKShareRequestAccessOperation`` and configure it to use the necessary priority.
fetchShareMetadatas(urls: Array<string>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func fetchShareMetadatas(for urls: [URL], completionHandler: @escaping @Sendable (Result<[URL : Result<CKShare.Metadata, any Error>], any Error>) -> Void)Fetches share metadatas for the specified share URLs. - Parameters: - urls: The share URLs that CloudKit uses to locate the metadatas. - completionHandler: The handler to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - A dictionary of fetched share metadatas. The dictionary uses the URLs you specify in `urls` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share metadata, or an error that describes why CloudKit can't fetch that share metadata. This method searches for share metadatas asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareMetadataOperation`` and configure it to use the necessary priority.
discoverUserIdentitiesForUserRecordIDsCompletionHandler(userRecordIDs: Array<CKRecord_ID>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func discoverUserIdentities(forUserRecordIDs userRecordIDs: [CKRecord.ID], completionHandler: @escaping @Sendable (Result<[CKRecord.ID : CKUserIdentity], any Error>) -> Void)Fetches the user identities for the specified user record IDs. - Parameters: - userRecordIDs: The users' user records IDs. - completionHandler: The handler to execute with the fetch results. This closure doesn't return a value and takes the following parameters: - A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the user record IDs In the successful case, the dictionary uses the user record IDs you specify in `userRecordIDs` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
discoverUserIdentitiesForPhoneNumbersCompletionHandler(phoneNumbers: Array<string>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func discoverUserIdentities(forPhoneNumbers phoneNumbers: [String], completionHandler: @escaping @Sendable (Result<[String : CKUserIdentity], any Error>) -> Void)Fetches the user identities for the specified phone numbers. - Parameters: - phoneNumbers: The users' phone numbers. - completionHandler: The handler to execute with the fetch results. This closure doesn't return a value and takes the following parameters: - A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the phone numbers. In the successful case, the dictionary uses the phone numbers you specify in `phoneNumbers` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
discoverUserIdentitiesForEmailAddressesCompletionHandler(emails: Array<string>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func discoverUserIdentities(forEmailAddresses emails: [String], completionHandler: @escaping @Sendable (Result<[String : CKUserIdentity], any Error>) -> Void)Fetches the user identities for the specified email addresses. - Parameters: - emails: The users' email addresses. - completionHandler: The handler to execute with the fetch results. This closure doesn't return a value and takes the following parameters: - A <doc://com.apple.documentation/documentation/swift/result> that contains either a dictionary of user identities, or an error that describes why CloudKit can't discover the email addresses. In the successful case, the dictionary uses the email addresses you specify in `emails` as its keys. Only successfully discovered user identities are present in this dictionary. Use this method to retrieve the identities of users who the current user knows. The users you're searching for must meet the following criteria: - The user has run the app. - The user grants the ``CKContainer/ApplicationPermissions/userDiscoverability`` permission for the container. This method searches for users asynchronously and with a low priority. If you want the task to execute the request with a higher priority, create an instance of ``CKDiscoverUserIdentitiesOperation`` and configure it to use the necessary priority.
fetchShareParticipantsForPhoneNumbersCompletionHandler(phoneNumbers: Array<string>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func fetchShareParticipants(forPhoneNumbers phoneNumbers: [String], completionHandler: @escaping @Sendable (Result<[String : Result<CKShare.Participant, any Error>], any Error>) -> Void)Fetches share participants with the specified phone numbers. - Parameters: - phoneNumbers: The share participants' phone numbers. - completionHandler: The handler to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - A dictionary of fetched share participants. The dictionary uses the phone numbers you specify in `phoneNumbers` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. CloudKit can translate any valid phone number into a share participant. If the phone number doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the phone number to an iCloud account. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
fetchShareParticipantsForUserRecordIDsCompletionHandler(userRecordIDs: Array<CKRecord_ID>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func fetchShareParticipants(forUserRecordIDs userRecordIDs: [CKRecord.ID], completionHandler: @escaping @Sendable (Result<[CKRecord.ID : Result<CKShare.Participant, any Error>], any Error>) -> Void)Fetches share participants with the specified user record IDs. - Parameters: - userRecordIDs: The share participants' user record IDs. - completionHandler: The handler to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - A dictionary of fetched share participants. The dictionary uses the user record IDs you specify in `userRecordIDs` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
fetchShareParticipantsForEmailAddressesCompletionHandler(emails: Array<string>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func fetchShareParticipants(forEmailAddresses emails: [String], completionHandler: @escaping @Sendable (Result<[String : Result<CKShare.Participant, any Error>], any Error>) -> Void)Fetches share participants with the specified email addresses. - Parameters: - emails: The share participants' email addresses. - completionHandler: The handler to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - A dictionary of fetched share participants. The dictionary uses the email addresses you specify in `emails` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share participant, or an error that describes why CloudKit can't fetch that share participant. CloudKit can translate any valid email address into a share participant. If the email address doesn't correspond to a known iCloud account, then at share-accept-time, CloudKit offers the accepting participant a vetting process. The accepting participant uses this vetting process to link the email address to an iCloud account. This method searches for share participants asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKFetchShareParticipantsOperation`` and configure it to use the necessary priority.
fetchLongLivedOperation(operationID: string, completionHandler: ((arg0: (CKOperation) | null, arg1: (NativeError) | null) => void)): voidSwift declaration@preconcurrency func fetchLongLivedOperation(withID operationID: CKOperation.ID, completionHandler: @escaping @Sendable (CKOperation?, (any Error)?) -> Void)Fetches the long-lived operation for the specified operation ID. - Parameters: - operationID: The operation's ID. - completionHandler: The closure to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - The long-lived operation. If the operation completes, or your app or the system cancels it, this parameter is `nil`. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the operation. A long-lived operation is one that continues to run after the user closes your app. When a long-lived operation completes, the system calls its completion block to notify you. After setting callback blocks on the returned long-lived operation, and starting the returned long-lived operation on an operation queue, the operation invokes all callbacks made while your app was closed.
allLongLivedOperationIDs(): Promise<Array<string>>Swift declarationfunc allLongLivedOperationIDs() async throws -> [CKOperation.ID]Fetches the IDs of any long-lived operations that are running and returns them to an awaiting caller. - Returns: The IDs of all of the long-lived operations that are running. A long-lived operation is one that continues to run after the user closes your app. When a long-lived operation completes, or your app or the system cancels it, it's no longer active and CloudKit doesn't include its ID in the returned array. An operation is complete when the system calls its completion handler. Use the ``CKContainer/longLivedOperation(for:)`` method to fetch the operation for a specific ID.
allUserIdentitiesFromContacts(): Promise<Array<CKUserIdentity>>Swift declarationfunc allUserIdentitiesFromContacts() async throws -> [CKUserIdentity]Fetches all user identities that match entries in the user's Contacts. - Returns: The user identities that match entries in the user's Contacts. This method searches for the users asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKDiscoverAllUserIdentitiesOperation`` and configure it to use the necessary priority.
fetchAllLongLivedOperationIDs(completionHandler: ((arg0: (Array<string>) | null, arg1: (NativeError) | null) => void)): voidSwift declaration@preconcurrency func fetchAllLongLivedOperationIDs(completionHandler: @escaping @Sendable ([CKOperation.ID]?, (any Error)?) -> Void)Fetches the IDs of any long-lived operations that are running. - Parameters: - completionHandler: The closure to execute with the fetch results. The closure doesn't return a value and takes the following parameters: - The IDs of all of the long-lived operations that are running. - An error if a problem occurs, or `nil` if CloudKit successfully retrieves the IDs. A long-lived operation is one that continues to run after the user closes your app. When a long-lived operation completes, or your app or the system cancels it, it's no longer active and CloudKit doesn't include its ID in `outstandingOperationsByIDs`. An operation is complete when the system calls its completion handler. Use the ``CKContainer/longLivedOperation(for:)`` method to fetch the operation for a specific ID.
acceptCompletionHandler19311(metadatas: Array<CKShare_Metadata>, completionHandler: ((arg0: SDKHandle) => void)): voidSwift declaration@preconcurrency func accept(_ metadatas: [CKShare.Metadata], completionHandler: @escaping @Sendable (Result<[CKShare.Metadata : Result<CKShare, any Error>], any Error>) -> Void)Accepts the specified share metadatas. - Parameters: - metadatas: The metadatas of the shares to accept. - completionHandler: The handler to execute when the process finishes. The closure doesn't return a value and takes the following parameters: - A dictionary of fetched shares. The dictionary uses the metadatas you specify in `metadatas` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding fetched share, or an error that describes why CloudKit can't fetch that share. This method accepts shares asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKAcceptSharesOperation`` and configure it to use the necessary priority.
accept(metadatas: Array<CKShare_Metadata>): Promise<NativeMap<CKShare_Metadata, SDKHandle>>Swift declarationfunc accept(_ metadatas: [CKShare.Metadata]) async throws -> [CKShare.Metadata : Result<CKShare, any Error>]Accepts the specified share metadatas and returns the accepted shares to an awaiting caller. - Parameters: - metadatas: The share metadatas of the shares to accept. - Returns: A dictionary of accepted shares. The dictionary uses the share metadatas you specify in `metadatas` as its keys. The value of each key is a <doc://com.apple.documentation/documentation/swift/result> that contains either the corresponding accepted share, or an error that describes why CloudKit can't accept that share. This method accepts shares asynchronously and with a low priority. If you want the task to execute with a higher priority, create an instance of ``CKAcceptSharesOperation`` and configure it to use the necessary priority.
accept27794(metadata: CKShare_Metadata): Promise<CKShare>Swift declarationfunc accept(_ metadata: CKShare.Metadata) async throws -> CKShareAccepts the specified share metadata and returns the accepted share to an awaiting caller. - Parameters: - metadata: The metadata of the share to accept. - Returns: The corresponding share for the share metadata.
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.
CKContainer.init()
inherited init: cannot prove legal (class declares 1 custom initializer)