<!--
{
  "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/PHAssetCollection",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHAssetCollection"
  },
  "title" : "PHAssetCollection"
}
-->

# PHAssetCollection

A representation of a Photos asset grouping, such as Moments, a user-created album, or a Smart Album.

```
class PHAssetCollection
```

## Overview

In the Photos framework, collection objects (including asset collections) do not directly reference their member objects, and there are no other objects that directly reference collection objects. To retrieve the members of an asset collection, fetch them with a [`PHAsset`](/documentation/Photos/PHAsset) class method such as [`fetchAssets(in:options:)`](/documentation/Photos/PHAsset/fetchAssets(in:options:)). To find asset collections, use one of the methods listed in the Fetching Asset Collections group below.

> Important:
> Accessing or modifying the Photos library requires explicit authorization from the user. The first time you call one of the methods listed in the Fetching Asset Collections group, Photos automatically prompts the user for authorization. (Alternatively, you can use the ``doc://com.apple.photokit/documentation/Photos/PHPhotoLibrary``  ``doc://com.apple.photokit/documentation/Photos/PHPhotoLibrary/requestAuthorization(_:)`` method to prompt the user at a time of your choosing.)
> 
> Your app’s `Info.plist` file must provide a value for the [NSPhotoLibraryUsageDescription](https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CocoaKeys.html#//apple_ref/doc/uid/TP40009251-SW17) key that explains to the user why your app is requesting Photos access. Apps linked on or after iOS 10.0 will crash if this key is not present.

Like assets and collection lists, asset collections are immutable. To create, rename, or delete asset collections, or to add, remove, or rearrange members in an asset collection, create a [`PHAssetCollectionChangeRequest`](/documentation/Photos/PHAssetCollectionChangeRequest) object within a photo library change block. For details on using change requests and change blocks to update the photo library, see [`PHPhotoLibrary`](/documentation/Photos/PHPhotoLibrary).

## Topics

### Fetching Asset Collections

[`+  fetchAssetCollectionsWithLocalIdentifiers:options:`](/documentation/Photos/PHAssetCollection/fetchAssetCollections(withLocalIdentifiers:options:))

Retrieves asset collections with the specified unique identifiers.

[`+  fetchAssetCollectionsWithType:subtype:options:`](/documentation/Photos/PHAssetCollection/fetchAssetCollections(with:subtype:options:))

Retrieves asset collections of the specified type and subtype.

[`+  fetchAssetCollectionsContainingAsset:withType:options:`](/documentation/Photos/PHAssetCollection/fetchAssetCollectionsContaining(_:with:options:))

Retrieves asset collections of the specified type containing the specified asset.

[`+  fetchAssetCollectionsWithALAssetGroupURLs:options:`](/documentation/Photos/PHAssetCollection/fetchAssetCollections(withALAssetGroupURLs:options:))

Retrieves asset collections using URLs provided by the Assets Library framework.

[`+  fetchMomentsInMomentList:options:`](/documentation/Photos/PHAssetCollection/fetchMoments(inMomentList:options:))

Retrieves asset collections in the specified moment list collection.

[`+  fetchMomentsWithOptions:`](/documentation/Photos/PHAssetCollection/fetchMoments(with:))

Retrieves asset collections corresponding to moments seen in the Photos app.

### Reading Asset Collection Metadata

[`assetCollectionType`](/documentation/Photos/PHAssetCollection/assetCollectionType)

The type of the asset collection, such as an album or a moment.

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

Major distinctions between kinds of asset collections, used by the [`assetCollectionType`](/documentation/Photos/PHAssetCollection/assetCollectionType) property and the [`fetchAssetCollectionsContaining(_:with:options:)`](/documentation/Photos/PHAssetCollection/fetchAssetCollectionsContaining(_:with:options:)) and [`fetchAssetCollections(with:subtype:options:)`](/documentation/Photos/PHAssetCollection/fetchAssetCollections(with:subtype:options:)) methods.

[`assetCollectionSubtype`](/documentation/Photos/PHAssetCollection/assetCollectionSubtype)

The subtype of the asset collection.

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

Minor distinctions between kinds of asset collections, used by the [`assetCollectionSubtype`](/documentation/Photos/PHAssetCollection/assetCollectionSubtype) property and the [`fetchAssetCollections(with:subtype:options:)`](/documentation/Photos/PHAssetCollection/fetchAssetCollections(with:subtype:options:)) method.

[`estimatedAssetCount`](/documentation/Photos/PHAssetCollection/estimatedAssetCount)

The estimated number of assets in the asset collection.

[`startDate`](/documentation/Photos/PHAssetCollection/startDate)

The earliest creation date among all assets in the asset collection.

[`endDate`](/documentation/Photos/PHAssetCollection/endDate)

The latest creation date among all assets in the asset collection.

[`approximateLocation`](/documentation/Photos/PHAssetCollection/approximateLocation)

A location representing those of all assets in the collection.

[`localizedLocationNames`](/documentation/Photos/PHAssetCollection/localizedLocationNames)

The names of locations grouped by the collection (an array of `NSString` objects).

### Creating Temporary Asset Collections

[`+  transientAssetCollectionWithAssets:title:`](/documentation/Photos/PHAssetCollection/transientAssetCollection(with:title:))

Creates a temporary asset collection containing the specified assets.

[`+  transientAssetCollectionWithAssetFetchResult:title:`](/documentation/Photos/PHAssetCollection/transientAssetCollection(withAssetFetchResult:title:))

Creates a temporary asset collection containing the assets from the specified fetch result.

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`CVarArg`](/documentation/Swift/CVarArg)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`NSCopying`](/documentation/Foundation/NSCopying)

[`Hashable`](/documentation/Swift/Hashable)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

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

### Inherited By

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

---

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)