---
title: "match(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspredicateeditorrowtemplate/match(for:)"
---

# match(for:)

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

## Declaration

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

## Return Value

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

## Discussion

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.

## See Also

### Primitive Methods

- [templateViews](appkit/nspredicateeditorrowtemplate/templateviews.md)
- [setPredicate(_:)](appkit/nspredicateeditorrowtemplate/setpredicate(_:).md)
- [displayableSubpredicates(of:)](appkit/nspredicateeditorrowtemplate/displayablesubpredicates(of:).md)
- [predicate(withSubpredicates:)](appkit/nspredicateeditorrowtemplate/predicate(withsubpredicates:).md)
