<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 3.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CloudKit",
  "identifier" : "/documentation/CloudKit/CKContainer/accept(_:completionHandler:)-949ea",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "CloudKit"
    ],
    "preciseIdentifier" : "c:objc(cs)CKContainer(im)acceptShareMetadata:completionHandler:"
  },
  "title" : "accept(_:completionHandler:)"
}
-->

# accept(_:completionHandler:)

Accepts the specified share metadata.

```
func accept(_ metadata: CKShare.Metadata, completionHandler: @escaping @Sendable (CKShare?, (any Error)?) -> Void)
```

## Parameters

`metadata`

The metadata of the share to accept.

`completionHandler`

The handler to execute when the process finishes.

## Discussion

The closure doesn’t return a value and takes the following parameters:

- The corresponding share, or `nil` if CloudKit can’t accept the metadata.
- An error if a problem occurs, or `nil` if CloudKit successfully accepts the metadata.

---

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)