---
title: "init(_:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nspredicate/init(_:)"
---

# init(_:)

Creates a predicate by converting an existing predicate.

## Declaration

```swift
convenience init?<Input>(_ predicate: Predicate<Input>) where Input : NSObject
```

## Parameters

- `predicate`: The predicate to convert.

## Return Value

Return Value The converted predicate, or nil if conversion fails.

## Discussion

Discussion Only a subset of predicates that can be expressed by Predicate are convertible to NSPredicate. Predicates that include operations like the following can’t be converted: Accessing key paths for properties that aren’t exposed to the Objective-C runtime. Capturing values of types that aren’t supported by NSPredicate, like custom Swift structures. Using some functions or operators, like performing collection operations on a nonstring value.

## See Also

### Creating a Predicate

- [init(format:argumentArray:)](foundation/nspredicate/init(format:argumentarray:).md)
- [init(format:arguments:)](foundation/nspredicate/init(format:arguments:).md)
- [init(format:_:)](foundation/nspredicate/init(format:_:).md)
- [withSubstitutionVariables(_:)](foundation/nspredicate/withsubstitutionvariables(_:).md)
- [init(value:)](foundation/nspredicate/init(value:).md)
- [init(block:)](foundation/nspredicate/init(block:).md)
- [init(fromMetadataQueryString:)](foundation/nspredicate/init(frommetadataquerystring:).md)
