---
title: "requestAuthorization(_:)"
framework: photos
role: symbol
role_heading: Type Method
path: "photos/phphotolibrary/requestauthorization(_:)"
---

# requestAuthorization(_:)

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

## Declaration

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

## Mentioned in

Delivering an Enhanced Privacy Experience in Your Photos App Fetching Assets

## See Also

### Verifying Authorization

- [authorizationStatus(for:)](photos/phphotolibrary/authorizationstatus(for:).md)
- [requestAuthorization(for:handler:)](photos/phphotolibrary/requestauthorization(for:handler:).md)
- [PHAccessLevel](photos/phaccesslevel.md)
- [PHAuthorizationStatus](photos/phauthorizationstatus.md)
- [authorizationStatus()](photos/phphotolibrary/authorizationstatus().md)
