---
title: "enumerateObjects(_:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsorderedset/enumerateobjects(_:)"
---

# enumerateObjects(_:)

Executes a given block using each object in the ordered set.

## Declaration

```swift
func enumerateObjects(_ block: (Any, Int, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## Parameters

- `block`: The block to apply to elements in the ordered set. The block takes three arguments: The block returns a Boolean value that indicates whether obj passed the test.

## See Also

### Accessing Set Members

- [contains(_:)](foundation/nsorderedset/contains(_:).md)
- [enumerateObjects(at:options:using:)](foundation/nsorderedset/enumerateobjects(at:options:using:).md)
- [enumerateObjects(options:using:)](foundation/nsorderedset/enumerateobjects(options:using:).md)
- [firstObject](foundation/nsorderedset/firstobject.md)
- [lastObject](foundation/nsorderedset/lastobject.md)
- [object(at:)](foundation/nsorderedset/object(at:).md)
- [subscript(_:)](foundation/nsorderedset/subscript(_:).md)
- [objects(at:)](foundation/nsorderedset/objects(at:).md)
- [index(of:)](foundation/nsorderedset/index(of:).md)
- [index(of:inSortedRange:options:usingComparator:)](foundation/nsorderedset/index(of:insortedrange:options:usingcomparator:).md)
- [index(ofObjectAt:options:passingTest:)](foundation/nsorderedset/index(ofobjectat:options:passingtest:).md)
- [index(ofObjectPassingTest:)](foundation/nsorderedset/index(ofobjectpassingtest:).md)
- [index(_:ofObjectPassingTest:)](foundation/nsorderedset/index(_:ofobjectpassingtest:).md)
- [indexes(ofObjectsAt:options:passingTest:)](foundation/nsorderedset/indexes(ofobjectsat:options:passingtest:).md)
- [indexes(ofObjectsPassingTest:)](foundation/nsorderedset/indexes(ofobjectspassingtest:).md)
