<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Contacts",
  "identifier" : "/documentation/Contacts/CNContactStore/requestAccess(for:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Contacts"
    ],
    "preciseIdentifier" : "c:objc(cs)CNContactStore(im)requestAccessForEntityType:completionHandler:"
  },
  "title" : "requestAccess(for:completionHandler:)"
}
-->

# requestAccess(for:completionHandler:)

Requests access to the user’s contacts.

```
func requestAccess(for entityType: CNEntityType, completionHandler: @escaping @Sendable (Bool, (any Error)?) -> Void)
```

## Parameters

`entityType`

Set to `CNEntityTypeContacts`.

`completionHandler`

Set granted to <doc://com.apple.documentation/documentation/Swift/true> if the user allows access and error is `nil`.

## Discussion

> Important: You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func requestAccess(for entityType: CNEntityType) async throws -> Bool
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

Users grant or deny access to contact data on a per-app basis. Request access to contact data by calling the [`requestAccess(for:completionHandler:)`](/documentation/Contacts/CNContactStore/requestAccess(for:completionHandler:)) method, which returns right away. The first time your app calls this method, the system prompts the user to grant or deny access to your app. The system then saves the user’s response and does not prompt them again.

The system executes `completionHandler` on an arbitrary queue. It is recommended that you use [`CNContactStore`](/documentation/Contacts/CNContactStore) instance methods in this completion handler instead of the UI main thread. This method is optional when [`CNContactStore`](/documentation/Contacts/CNContactStore) is used in the background thread. If you don’t request access, [`CNContactStore`](/documentation/Contacts/CNContactStore) may block your app while asking the user for access.

---

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)