<!--
{
  "availability" : [
    "iOS: 8.0.0 - 27.0.0",
    "iPadOS: 8.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.13.0 - 27.0.0",
    "tvOS: 10.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "PhotoKit",
  "identifier" : "/documentation/Photos/PHPhotoLibrary/requestAuthorization(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHPhotoLibrary(cm)requestAuthorization:"
  },
  "title" : "requestAuthorization(_:)"
}
-->

# requestAuthorization(_:)

Requests the user’s permission, if needed, to access the photo library.

```
class func requestAuthorization(_ handler: @escaping (PHAuthorizationStatus) -> Void)
```

## Parameters

`handler`

A block Photos calls upon determining your app’s authorization to access the photo library.

    The block takes a single parameter:

- status: The current authorization status.

---

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)