<!--
{
  "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/enumerateObjects(at:options:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Photos"
    ],
    "preciseIdentifier" : "c:objc(cs)PHFetchResult(im)enumerateObjectsAtIndexes:options:usingBlock:"
  },
  "title" : "enumerateObjects(at:options:using:)"
}
-->

# enumerateObjects(at:options:using:)

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

```
func enumerateObjects(at s: IndexSet, options opts: NSEnumerationOptions = [], using block: @escaping (ObjectType, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## Parameters

`s`

The indexes of the objects over which to enumerate.

`opts`

A bit mask that specifies the options for the enumeration (whether it should be performed concurrently and whether it should be performed in reverse order).

`block`

The block to apply to elements in the fetch result.

    The block takes three parameters:

- obj: The element in the fetch result.
- idx: The index of the element in the fetch result.
- stop: A pointer to a Boolean value. Set `*stop` to `true` within the block to cancel further processing of the fetch result.

## Discussion

By default, the enumeration starts with the first object and continues in order through the fetch result to the last element specified by the index set. Specify the `concurrent` or `reverse` options to modify this behavior.

This method executes synchronously.

---

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)