<!--
{
  "availability" : [
    "iOS: 4.0.0 -",
    "iPadOS: 4.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSDictionary/enumerateKeysAndObjects(options:using:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDictionary(im)enumerateKeysAndObjectsWithOptions:usingBlock:"
  },
  "title" : "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.

```
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

If the block sets `*stop` to <doc://com.apple.documentation/documentation/Swift/true>, the enumeration stops.

---

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)