---
title: PHAssetCollection
framework: photos
role: symbol
role_heading: Class
path: photos/phassetcollection
---

# PHAssetCollection

A representation of a Photos asset grouping, such as a moment, user-created album, or smart album.

## Declaration

```swift
class PHAssetCollection
```

## Mentioned in

Requesting Changes to the Photo Library Fetching Objects and Requesting Changes

## Overview

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 class method such as 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 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 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 object within a photo library change block. For details on using change requests and change blocks to update the photo library, see PHPhotoLibrary.

## Topics

### Fetching Asset Collections

- [fetchAssetCollections(withLocalIdentifiers:options:)](photos/phassetcollection/fetchassetcollections(withlocalidentifiers:options:).md)
- [fetchAssetCollections(with:subtype:options:)](photos/phassetcollection/fetchassetcollections(with:subtype:options:).md)
- [fetchAssetCollectionsContaining(_:with:options:)](photos/phassetcollection/fetchassetcollectionscontaining(_:with:options:).md)
- [fetchAssetCollections(withALAssetGroupURLs:options:)](photos/phassetcollection/fetchassetcollections(withalassetgroupurls:options:).md)
- [fetchMoments(inMomentList:options:)](photos/phassetcollection/fetchmoments(inmomentlist:options:).md)
- [fetchMoments(with:)](photos/phassetcollection/fetchmoments(with:).md)

### Reading Asset Collection Metadata

- [assetCollectionType](photos/phassetcollection/assetcollectiontype.md)
- [PHAssetCollectionType](photos/phassetcollectiontype.md)
- [assetCollectionSubtype](photos/phassetcollection/assetcollectionsubtype.md)
- [PHAssetCollectionSubtype](photos/phassetcollectionsubtype.md)
- [estimatedAssetCount](photos/phassetcollection/estimatedassetcount.md)
- [startDate](photos/phassetcollection/startdate.md)
- [endDate](photos/phassetcollection/enddate.md)
- [approximateLocation](photos/phassetcollection/approximatelocation.md)
- [localizedLocationNames](photos/phassetcollection/localizedlocationnames.md)

### Creating Temporary Asset Collections

- [transientAssetCollection(with:title:)](photos/phassetcollection/transientassetcollection(with:title:).md)
- [transientAssetCollection(withAssetFetchResult:title:)](photos/phassetcollection/transientassetcollection(withassetfetchresult:title:).md)

## Relationships

### Inherits From

- [PHCollection](photos/phcollection.md)

### Inherited By

- [PHProject](photos/phproject.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Asset retrieval

- [Fetching Objects and Requesting Changes](photokit/fetching-objects-and-requesting-changes.md)
- [PHAsset](photos/phasset.md)
- [PHCollection](photos/phcollection.md)
- [PHCollectionList](photos/phcollectionlist.md)
- [PHObject](photos/phobject.md)
- [PHFetchResult](photos/phfetchresult.md)
- [PHFetchOptions](photos/phfetchoptions.md)
