---
title: "enumerateKeysAndObjects(options:using:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsdictionary/enumeratekeysandobjects(options:using:)"
---

# enumerateKeysAndObjects(options:using:)

Applies a given block object to the entries of the dictionary, with options specifying how the enumeration is performed.

## Declaration

```swift
func enumerateKeysAndObjects(options opts: NSEnumerationOptions = [], using block: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Void)
```

## Parameters

- `opts`: Enumeration options.
- `block`: A block object to operate on entries in the dictionary.

## Discussion

Discussion If the block sets *stop to true, the enumeration stops.

## See Also

### Enumerating Dictionaries

- [keyEnumerator()](foundation/nsdictionary/keyenumerator().md)
- [objectEnumerator()](foundation/nsdictionary/objectenumerator().md)
- [enumerateKeysAndObjects(_:)](foundation/nsdictionary/enumeratekeysandobjects(_:).md)
- [makeIterator()](foundation/nsdictionary/makeiterator().md)
