---
title: "init(shareMetadatas:)"
framework: cloudkit
role: symbol
role_heading: Initializer
path: "cloudkit/ckacceptsharesoperation/init(sharemetadatas:)"
---

# init(shareMetadatas:)

Creates an operation for accepting the specified shares.

## Declaration

```swift
convenience init(shareMetadatas: [CKShare.Metadata])
```

## Parameters

- `shareMetadatas`: The share metadatas to accept. If you specify nil, you must assign a value to the doc://com.apple.cloudkit/documentation/CloudKit/CKAcceptSharesOperation/shareMetadatas property before you execute the operation.

## Discussion

Discussion After initializing the operation, assign a handler to the acceptSharesCompletionBlock property to process the results.

## See Also

### Creating a Share Accept Operation

- [init()](cloudkit/ckacceptsharesoperation/init().md)
