---
title: "indexes(options:passingTest:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsindexset/indexes(options:passingtest:)"
---

# indexes(options:passingTest:)

Returns an NSIndexSet containing the receiving index set’s objects that pass the Block test using the specified enumeration options.

## Declaration

```swift
func indexes(options opts: NSEnumerationOptions = [], passingTest predicate: (Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> IndexSet
```

## Parameters

- `opts`: A bitmask that specifies the options for the enumeration (whether it should be performed concurrently and whether it should be performed in reverse order). See doc://com.apple.foundation/documentation/Foundation/NSEnumerationOptions for the supported values.
- `predicate`: The Block to apply to elements in the set. The Block takes two arguments: The Block returns a Boolean value that indicates whether obj passed the test.

## Return Value

Return Value An NSIndexSet containing the indexes of the receiving index set that passed the predicate Block test.

## See Also

### Querying Index Sets

- [contains(_:)](foundation/nsindexset/contains(_:)-bb19.md)
- [contains(_:)](foundation/nsindexset/contains(_:)-5j2kh.md)
- [contains(in:)](foundation/nsindexset/contains(in:).md)
- [intersects(in:)](foundation/nsindexset/intersects(in:).md)
- [count](foundation/nsindexset/count.md)
- [countOfIndexes(in:)](foundation/nsindexset/countofindexes(in:).md)
- [index(passingTest:)](foundation/nsindexset/index(passingtest:).md)
- [indexes(passingTest:)](foundation/nsindexset/indexes(passingtest:).md)
- [index(options:passingTest:)](foundation/nsindexset/index(options:passingtest:).md)
- [index(in:options:passingTest:)](foundation/nsindexset/index(in:options:passingtest:).md)
- [indexes(in:options:passingTest:)](foundation/nsindexset/indexes(in:options:passingtest:).md)
