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

# PHFetchResult

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

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

## Overview

When you use class methods on the [`PHAsset`](/documentation/Photos/PHAsset), [`PHCollection`](/documentation/Photos/PHCollection), [`PHAssetCollection`](/documentation/Photos/PHAssetCollection), and [`PHCollectionList`](/documentation/Photos/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 <doc://com.apple.documentation/documentation/Foundation/NSArray> class. Unlike an <doc://com.apple.documentation/documentation/Foundation/NSArray> object, however, a [`PHFetchResult`](/documentation/Photos/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`](/documentation/Photos/PHFetchResult/count) value is constant, and all objects in the fetch result keep the same [`localIdentifier`](/documentation/Photos/PHObject/localIdentifier) value. (To get updated content for a fetch, register a change observer with the shared [`PHPhotoLibrary`](/documentation/Photos/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

[`-  containsObject:`](/documentation/Photos/PHFetchResult/contains(_:))

Returns whether the specified object is present in the fetch result.

[`count`](/documentation/Photos/PHFetchResult/count)

The number of objects in the fetch result.

[`-  countOfAssetsWithMediaType:`](/documentation/Photos/PHFetchResult/countOfAssets(with:))

Returns the number of assets in the fetch result of a specified type.

[`firstObject`](/documentation/Photos/PHFetchResult/firstObject)

The first object in the fetch result.

[`lastObject`](/documentation/Photos/PHFetchResult/lastObject)

The last object in the fetch result.

[`-  objectAtIndex:`](/documentation/Photos/PHFetchResult/object(at:))

Returns the object located at the specified index.

[`-  objectAtIndexedSubscript:`](/documentation/Photos/PHFetchResult/subscript(_:))

Returns the object located at the specified index.

[`-  objectsAtIndexes:`](/documentation/Photos/PHFetchResult/objects(at:))

Returns an array containing the objects in the fetch result at the indexes in the specified index set.

### Finding Objects in a Fetch Result

[`-  indexOfObject:`](/documentation/Photos/PHFetchResult/index(of:))

Returns the lowest index whose corresponding object in the fetch result is equal to the specified object.

[`-  indexOfObject:inRange:`](/documentation/Photos/PHFetchResult/index(of:in:))

Returns the lowest index within the specified range whose corresponding object in the fetch result is equal to the specified object.

### Performing Operations with Objects in a Fetch Result

[`-  enumerateObjectsAtIndexes:options:usingBlock:`](/documentation/Photos/PHFetchResult/enumerateObjects(at:options:using:))

Executes the specified block using the objects in the fetch result at the specified indexes.

[`-  enumerateObjectsUsingBlock:`](/documentation/Photos/PHFetchResult/enumerateObjects(_:))

Executes the specified block using each object in the fetch result, starting with the first object and continuing in order to the last object.

[`-  enumerateObjectsWithOptions:usingBlock:`](/documentation/Photos/PHFetchResult/enumerateObjects(options:using:))

Executes the specified block using each object in the fetch result.

## Relationships

### Conforms To

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

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

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

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

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

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

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

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

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

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)