---
title: "init(leftExpression:rightExpression:modifier:type:options:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nscomparisonpredicate/init(leftexpression:rightexpression:modifier:type:options:)"
---

# init(leftExpression:rightExpression:modifier:type:options:)

Creates a predicate to a specified type that you form by combining specified left and right expressions using a specified modifier and options.

## Declaration

```swift
init(leftExpression lhs: NSExpression, rightExpression rhs: NSExpression, modifier: NSComparisonPredicate.Modifier, type: NSComparisonPredicate.Operator, options: NSComparisonPredicate.Options = [])
```

## Parameters

- `lhs`: The left hand expression.
- `rhs`: The right hand expression.
- `modifier`: The modifier to apply.
- `type`: The predicate operator type.
- `options`: The options to apply (see doc://com.apple.foundation/documentation/Foundation/NSComparisonPredicate/Options-swift.struct). For no options, pass 0.

## Return Value

Return Value The receiver, initialized to a predicate of type type formed by combining the left and right expressions using the modifier and options.

## See Also

### Creating Comparison Predicates

- [Displaying searchable content by using a search controller](uikit/displaying-searchable-content-by-using-a-search-controller.md)
- [init(leftExpression:rightExpression:customSelector:)](foundation/nscomparisonpredicate/init(leftexpression:rightexpression:customselector:).md)
- [init(coder:)](foundation/nscomparisonpredicate/init(coder:).md)
