<!--
{
  "availability" : [
    "macOS: 10.5.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSPredicateEditorRowTemplate/match(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSPredicateEditorRowTemplate(im)matchForPredicate:"
  },
  "title" : "match(for:)"
}
-->

# match(for:)

Returns a positive number if the receiver can represent a given predicate, and `0` if it cannot.

```
func match(for predicate: NSPredicate) -> Double
```

## Return Value

A positive number if the template can represent `predicate`, and `0` if it cannot.

## Discussion

By default, returns values in the range `0` to `1`.

The highest match among all the templates determines which template is responsible for displaying the predicate. You can override this to determine which predicates your custom template handles.

---

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)