<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: 15.0.0 -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKContainer/accept(_:)-t0ny",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "s:So11CKContainerC8CloudKitE6acceptySDySo15CKShareMetadataCs6ResultOySo0E0Cs5Error_pGGSayAFGYaKF"
  },
  "title" : "accept(_:)"
}
-->

# accept(_:)

Accepts the specified share metadatas and returns the accepted shares to an awaiting caller.

```
func accept(_ metadatas: [CKShare.Metadata]) async throws -> [CKShare.Metadata : Result<CKShare, any Error>]
```

## Parameters

`metadatas`

The share metadatas of the shares to accept.

## Return Value

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.

## Discussion

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`](/documentation/CloudKit/CKAcceptSharesOperation) and configure it to use the necessary priority.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)