---
title: "predicate(withSubpredicates:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nspredicateeditorrowtemplate/predicate(withsubpredicates:)"
---

# predicate(withSubpredicates:)

Returns the predicate represented by the receiver’s views’ values and the given sub-predicates.

## Declaration

```swift
func predicate(withSubpredicates subpredicates: [NSPredicate]?) -> NSPredicate
```

## Parameters

- `subpredicates`: An array of predicates.

## Return Value

Return Value The predicate represented by the values of the template’s views and the given subpredicates. You can override this method to return the predicate represented by your custom views.

## Discussion

Discussion This method is only called if match(for:) returned a positive value for the receiver. You can override this method to return the predicate represented by a custom view.

## See Also

### Primitive Methods

- [match(for:)](appkit/nspredicateeditorrowtemplate/match(for:).md)
- [templateViews](appkit/nspredicateeditorrowtemplate/templateviews.md)
- [setPredicate(_:)](appkit/nspredicateeditorrowtemplate/setpredicate(_:).md)
- [displayableSubpredicates(of:)](appkit/nspredicateeditorrowtemplate/displayablesubpredicates(of:).md)
