Contents

requestShareAccess(for:)

Requests access to the specified share URLs, and returns the results to an awaiting caller.

Declaration

func requestShareAccess(for urls: [URL]) async throws -> [URL : Result<Void, any Error>]

Parameters

  • urls:

    The share URLs that CloudKit uses to locate the shares.

Return Value

A dictionary of acceptance results. The dictionary uses the urls you specify in urls as its keys. The value of each key is a Result is .success, or an error that describes why CloudKit can’t request access to that share.

Discussion

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.