---
title: "templates(withAttributeKeyPaths:in:)"
framework: appkit
role: symbol
role_heading: Type Method
path: "appkit/nspredicateeditorrowtemplate/templates(withattributekeypaths:in:)"
---

# templates(withAttributeKeyPaths:in:)

Returns an array of predicate templates for the given attribute key paths for a given entity.

## Declaration

```swift
class func templates(withAttributeKeyPaths keyPaths: [String], in entityDescription: NSEntityDescription) -> [NSPredicateEditorRowTemplate]
```

## Parameters

- `keyPaths`: An array of attribute key paths originating at entityDescription. The key paths may cross relationships but must terminate in attributes.
- `entityDescription`: A Core Data entity description.

## Return Value

Return Value An array of predicate templates for keyPaths originating at entityDescription.

## Discussion

Discussion This method determines which key paths in the entity description can use the same views (that is, share the same attribute type). For each of these groups, it instantiates individual templates via init(leftExpressions:rightExpressions:modifier:operators:options:).
