---
title: "setPredicate(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspredicateeditorrowtemplate/setpredicate(_:)"
---

# setPredicate(_:)

Sets the value of the views according to the given predicate.

## Declaration

```swift
func setPredicate(_ predicate: NSPredicate)
```

## Parameters

- `predicate`: The predicate value for the receiver.

## Discussion

Discussion This method is only called if match(for:) returned a positive value for the receiver. You can override this to set the values of custom views.

## See Also

### Primitive Methods

- [match(for:)](appkit/nspredicateeditorrowtemplate/match(for:).md)
- [templateViews](appkit/nspredicateeditorrowtemplate/templateviews.md)
- [displayableSubpredicates(of:)](appkit/nspredicateeditorrowtemplate/displayablesubpredicates(of:).md)
- [predicate(withSubpredicates:)](appkit/nspredicateeditorrowtemplate/predicate(withsubpredicates:).md)
