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

# init(leftExpression:rightExpression:customSelector:)

Creates a predicate that you form by combining specified left and right expressions using a specified selector.

## Declaration

```swift
init(leftExpression lhs: NSExpression, rightExpression rhs: NSExpression, customSelector selector: Selector)
```

## Parameters

- `lhs`: The left hand expression.
- `rhs`: The right hand expression.
- `selector`: The selector to use. The method defined by the selector must take a single argument and return a BOOL value.

## Return Value

Return Value The receiver, initialized by combining the left and right expressions using selector.

## 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:modifier:type:options:)](foundation/nscomparisonpredicate/init(leftexpression:rightexpression:modifier:type:options:).md)
- [init(coder:)](foundation/nscomparisonpredicate/init(coder:).md)
