<!--
{
  "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/keysOfEntries(options:passingTest:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSDictionary(im)keysOfEntriesWithOptions:passingTest:"
  },
  "title" : "keysOfEntries(options:passingTest:)"
}
-->

# keysOfEntries(options:passingTest:)

Returns the set of keys whose corresponding value satisfies a constraint described by a block object.

```
func keysOfEntries(options opts: NSEnumerationOptions = [], passingTest predicate: (Any, Any, UnsafeMutablePointer<ObjCBool>) -> Bool) -> Set<AnyHashable>
```

## Parameters

`opts`

A bit mask of enumeration options.

`predicate`

A block object that specifies constraints for values in the dictionary.

## Return Value

The set of keys whose corresponding value satisfies `predicate`.

## See Also

[`-  enumerateKeysAndObjectsWithOptions:usingBlock:`](/documentation/Foundation/NSDictionary/enumerateKeysAndObjects(options:using:))

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



---

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)