---
title: PHFetchResult
framework: photos
role: symbol
role_heading: Class
path: photos/phfetchresult
---

# PHFetchResult

An ordered list of assets or collections returned from a Photos fetch method.

## Declaration

```swift
class PHFetchResult<ObjectType> where ObjectType : AnyObject
```

## Mentioned in

Uploading asset resources in the background

## Overview

Overview When you use class methods on the PHAsset, PHCollection, PHAssetCollection, and PHCollectionList classes to retrieve objects, Photos provides the resulting objects in a fetch result. You access the contents of a fetch result with the same methods and conventions used by the NSArray class. Unlike an NSArray object, however, a PHFetchResult object dynamically loads its contents from the Photos library as needed, providing optimal performance even when handling a large number of results. A fetch result provides thread-safe access to its contents. After a fetch, the fetch result’s count value is constant, and all objects in the fetch result keep the same localIdentifier value. (To get updated content for a fetch, register a change observer with the shared PHPhotoLibrary object.) A fetch result caches its contents, keeping a batch of objects around the most recently accessed index. Because objects outside of the batch are no longer cached, accessing these objects results in refetching those objects. This process can result in changes to values previously read from those objects.

## Topics

### Querying a Fetch Result

- [contains(_:)](photos/phfetchresult/contains(_:).md)
- [count](photos/phfetchresult/count.md)
- [countOfAssets(with:)](photos/phfetchresult/countofassets(with:).md)
- [firstObject](photos/phfetchresult/firstobject.md)
- [lastObject](photos/phfetchresult/lastobject.md)
- [object(at:)](photos/phfetchresult/object(at:).md)
- [subscript(_:)](photos/phfetchresult/subscript(_:).md)
- [objects(at:)](photos/phfetchresult/objects(at:).md)

### Finding Objects in a Fetch Result

- [index(of:)](photos/phfetchresult/index(of:).md)
- [index(of:in:)](photos/phfetchresult/index(of:in:).md)

### Performing Operations with Objects in a Fetch Result

- [enumerateObjects(at:options:using:)](photos/phfetchresult/enumerateobjects(at:options:using:).md)
- [enumerateObjects(_:)](photos/phfetchresult/enumerateobjects(_:).md)
- [enumerateObjects(options:using:)](photos/phfetchresult/enumerateobjects(options:using:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.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)
- [NSFastEnumeration](foundation/nsfastenumeration.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)
- [PHAssetCollection](photos/phassetcollection.md)
- [PHCollection](photos/phcollection.md)
- [PHCollectionList](photos/phcollectionlist.md)
- [PHObject](photos/phobject.md)
- [PHFetchOptions](photos/phfetchoptions.md)
