<!--
{
  "availability" : [
    "iOS: 3.0.0 -",
    "iPadOS: 3.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.4.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSComparisonPredicate/init(leftExpression:rightExpression:customSelector:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSComparisonPredicate(im)initWithLeftExpression:rightExpression:customSelector:"
  },
  "title" : "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.

```
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

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

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)