requestAuthorization(for:handler:)
Prompts the user to grant the app permission to access the photo library.
Declaration
class func requestAuthorization(for accessLevel: PHAccessLevel, handler: @escaping @Sendable (PHAuthorizationStatus) -> Void)class func requestAuthorization(for accessLevel: PHAccessLevel) async -> PHAuthorizationStatusParameters
- accessLevel:
The access level to request.
- handler:
The callback the system invokes when it’s made a determination of the app’s status.
Mentioned in
Discussion
For more information about accessing the user’s Photos library, see Delivering an Enhanced Privacy Experience in Your Photos App.