accept(_:completionHandler:)
Accepts the specified share metadatas.
Declaration
@preconcurrency func accept(_ metadatas: [CKShare.Metadata], completionHandler: @escaping @Sendable (Result<[CKShare.Metadata : Result<CKShare, any Error>], any Error>) -> Void)Parameters
- metadatas:
The metadatas of the shares to accept.
- completionHandler:
The handler to execute when the process finishes.
Discussion
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
metadatasas its keys. The value of each key is a 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.