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

# PHPhotoLibrary

An object that manages access and changes to the user’s photo library.

```
class PHPhotoLibrary
```

## Overview

The object represents the entire set of assets and collections that the Photos app manages, including assets stored on the local device and those stored in iCloud Photos. Use this object for the following tasks:

- Retrieving or verifying the user’s permission for your app to access Photos content
- Making changes to assets and collections; for example, editing asset metadata or content, inserting new assets, or rearranging the members of a collection
- Determining which records change since a previous state of the Photos library
- Registering for update messages the system sends when the library changes

## Topics

### Verifying Authorization

[`authorizationStatus(for:)`](/documentation/Photos/PHPhotoLibrary/authorizationStatus(for:))

Returns the app’s authorization to access the user’s photo library for the specified access level.

[`requestAuthorization(for:handler:)`](/documentation/Photos/PHPhotoLibrary/requestAuthorization(for:handler:))

Prompts the user to grant the app permission to access the photo library.

[`PHAccessLevel`](/documentation/Photos/PHAccessLevel)

The app’s level of access to the user’s photo library.

[`PHAuthorizationStatus`](/documentation/Photos/PHAuthorizationStatus)

Information about your app’s authorization to access the user’s photo library.

[`authorizationStatus()`](/documentation/Photos/PHPhotoLibrary/authorizationStatus())

Returns information about your app’s authorization to access the user’s photo library.

[`requestAuthorization(_:)`](/documentation/Photos/PHPhotoLibrary/requestAuthorization(_:))

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

### Accessing the Shared Library

[`shared()`](/documentation/Photos/PHPhotoLibrary/shared())

Retrieves the shared photo library object.

### Presenting the Limited Library Picker

[`presentLimitedLibraryPicker(from:)`](/documentation/Photos/PHPhotoLibrary/presentLimitedLibraryPicker(from:))

Prompts the user to update their limited library selection.

[`presentLimitedLibraryPicker(from:completionHandler:)`](/documentation/Photos/PHPhotoLibrary/presentLimitedLibraryPicker(from:completionHandler:))

Prompts the user to update their limited library selection with a callback providing newly selected identifiers.

### Updating the Library

  <doc://com.apple.photokit/documentation/PhotoKit/requesting-changes-to-the-photo-library>

[`performChanges(_:completionHandler:)`](/documentation/Photos/PHPhotoLibrary/performChanges(_:completionHandler:))

Asynchronously runs a block that requests changes to the photo library.

[`performChangesAndWait(_:)`](/documentation/Photos/PHPhotoLibrary/performChangesAndWait(_:))

Synchronously runs a block that requests changes to be performed in the photo library.

[`PHChangeRequest`](/documentation/Photos/PHChangeRequest)

The abstract base class of the framework’s photo library change requests.

[`PHAssetChangeRequest`](/documentation/Photos/PHAssetChangeRequest)

A request to create, delete, change metadata for, or edit the content of a Photos asset, for use in a photo library change block.

[`PHAssetCollectionChangeRequest`](/documentation/Photos/PHAssetCollectionChangeRequest)

A request to create, delete, or modify a Photos asset collection, for use in a photo library change block.

[`PHCollectionListChangeRequest`](/documentation/Photos/PHCollectionListChangeRequest)

A request to create, delete, or modify a Photos collection list, for use in a photo library change block.

[`PHObjectPlaceholder`](/documentation/Photos/PHObjectPlaceholder)

A read-only proxy object that represents a Photos asset or collection to create.

### Fetching Change History

[`fetchPersistentChanges(since:)`](/documentation/Photos/PHPhotoLibrary/fetchPersistentChanges(since:))

Retrieves the Photos library changes since the token you specify.

[`PHPersistentChangeFetchResult`](/documentation/Photos/PHPersistentChangeFetchResult)

An object that represents a fetch result and allows you to enumerate a very large set of change records.

[`currentChangeToken`](/documentation/Photos/PHPhotoLibrary/currentChangeToken)

The opaque token that represents the current state of the Photos library.

[`PHPersistentChangeToken`](/documentation/Photos/PHPersistentChangeToken)

An opaque object that tracks the state of the Photos library between runs, and that you can copy and serialize for future use.

### Observing Library Changes

  <doc://com.apple.photokit/documentation/PhotoKit/observing-changes-in-the-photo-library>

[`register(_:)`](/documentation/Photos/PHPhotoLibrary/register(_:)-6y3b9)

Registers an object to receive messages when objects in the photo library change.

[`unregisterChangeObserver(_:)`](/documentation/Photos/PHPhotoLibrary/unregisterChangeObserver(_:))

Unregisters an object so that it no longer receives change messages.

[`PHPhotoLibraryChangeObserver`](/documentation/Photos/PHPhotoLibraryChangeObserver)

A protocol to adopt to have the system notify your app of changes to the photo library.

[`PHChange`](/documentation/Photos/PHChange)

A description of a change that occurred in the photo library.

[`PHObjectChangeDetails`](/documentation/Photos/PHObjectChangeDetails)

A description of changes that occurred in an asset or collection object.

[`PHFetchResultChangeDetails`](/documentation/Photos/PHFetchResultChangeDetails)

A description of changes that occurred in the set of asset or collection objects listed in a fetch result.

### Observing Library Availability

[`register(_:)`](/documentation/Photos/PHPhotoLibrary/register(_:)-gm0a)

Registers an object to observe changes to the photo library’s availability.

[`unregisterAvailabilityObserver(_:)`](/documentation/Photos/PHPhotoLibrary/unregisterAvailabilityObserver(_:))

Unregisters an object from observing changes to the photo library’s availability.

[`PHPhotoLibraryAvailabilityObserver`](/documentation/Photos/PHPhotoLibraryAvailabilityObserver)

A protocol to adopt to have the system notify your app when the availability of a photo library changes.

[`unavailabilityReason`](/documentation/Photos/PHPhotoLibrary/unavailabilityReason)

An error that describes the reason the photo library isn’t available.

### Converting Between Local and iCloud Identifiers

[`cloudIdentifierMappings(forLocalIdentifiers:)`](/documentation/Photos/PHPhotoLibrary/cloudIdentifierMappings(forLocalIdentifiers:))

Retrieves the cloud identifier mappings for the list of local identifiers.

[`localIdentifierMappings(for:)`](/documentation/Photos/PHPhotoLibrary/localIdentifierMappings(for:))

Retrieves the local identifier mappings for the list of cloud identifiers.

[`cloudIdentifierMappingsForLocalIdentifiers:`](/documentation/Photos/PHPhotoLibrary/cloudIdentifierMappingsForLocalIdentifiers:)

Retrieves the cloud identifier mappings for the list of local identifiers.

[`localIdentifierMappingsForCloudIdentifiers:`](/documentation/Photos/PHPhotoLibrary/localIdentifierMappingsForCloudIdentifiers:)

Retrieves the local identifier mappings for the list of cloud identifiers.

[`PHCloudIdentifier`](/documentation/Photos/PHCloudIdentifier)

An object that identifies an asset or collection that syncs through iCloud Photos.

[`PHCloudIdentifierMapping`](/documentation/Photos/PHCloudIdentifierMapping)

An object that contains the cloud identifier result from looking up a local identifier, or an error indicating why the lookup failed.

[`PHLocalIdentifierMapping`](/documentation/Photos/PHLocalIdentifierMapping)

An object that contains the local identifier result from looking up a cloud identifier, or an error indicating why the lookup failed.

[`cloudIdentifiers(forLocalIdentifiers:)`](/documentation/Photos/PHPhotoLibrary/cloudIdentifiers(forLocalIdentifiers:))

Retrieves the equivalent iCloud identifiers for the list of local identifiers.

[`localIdentifiers(for:)`](/documentation/Photos/PHPhotoLibrary/localIdentifiers(for:))

Retrieves the equivalent local identifiers for the list of iCloud identifiers.

[`PHLocalIdentifierNotFound`](/documentation/Photos/PHLocalIdentifierNotFound)

A constant value that indicates that the system can’t resolve a local object from a global identifier.

### Enabling an Upload Job Extension

[`uploadJobExtensionEnabled`](/documentation/Photos/PHPhotoLibrary/uploadJobExtensionEnabled)

A Boolean value that indicates whether background asset resource uploading is enabled.

[`setUploadJobExtensionEnabled(_:)`](/documentation/Photos/PHPhotoLibrary/setUploadJobExtensionEnabled(_:))

Enables or disables the background asset resource upload job feature.



---

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)