<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSApplicationDelegate/application(_:userDidAcceptCloudKitShareWith:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSApplicationDelegate(im)application:userDidAcceptCloudKitShareWithMetadata:"
  },
  "title" : "application(_:userDidAcceptCloudKitShareWith:)"
}
-->

# application(_:userDidAcceptCloudKitShareWith:)

Tells the delegate when the user accepts a CloudKit sharing invitation.

```
@MainActor optional func application(_ application: NSApplication, userDidAcceptCloudKitShareWith metadata: CKShareMetadata)
```

## Parameters

`application`

The shared app object.

`metadata`

The metadata associated with the invitation. Use the URL of the metadata’s <doc://com.apple.documentation/documentation/CloudKit/CKShare> object and the <doc://com.apple.documentation/documentation/CloudKit/CKShare/Metadata/containerIdentifier> property to schedule a <doc://com.apple.documentation/documentation/CloudKit/CKAcceptSharesOperation> object.

## Discussion

Use the provided metadata to begin sharing the specified content with the current user. For more information, see <doc://com.apple.documentation/documentation/CloudKit>.

---

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)