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

# indexes(passingTest:)

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

## Declaration

```swift
func indexes(passingTest predicate: (Int, UnsafeMutablePointer<ObjCBool>) -> Bool) -> IndexSet
```

## Parameters

- `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)
- [index(options:passingTest:)](foundation/nsindexset/index(options:passingtest:).md)
- [indexes(options:passingTest:)](foundation/nsindexset/indexes(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)
