---
title: "application(_:userDidAcceptCloudKitShareWith:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsapplicationdelegate/application(_:userdidacceptcloudkitsharewith:)"
---

# application(_:userDidAcceptCloudKitShareWith:)

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

## Declaration

```swift
@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

Discussion Use the provided metadata to begin sharing the specified content with the current user. For more information, see CloudKit.
