---
title: "init(expressionType:)"
framework: foundation
role: symbol
role_heading: Initializer
path: "foundation/nsexpression/init(expressiontype:)"
---

# init(expressionType:)

Creates the expression with the specified expression type.

## Declaration

```swift
init(expressionType type: NSExpression.ExpressionType)
```

## Parameters

- `type`: The type of the new expression, as defined by doc://com.apple.foundation/documentation/Foundation/NSExpression/ExpressionType-swift.enum.

## Return Value

Return Value An initialized NSExpression object of the type type.

## Discussion

Discussion This method is the designated initializer for NSExpression.

## See Also

### Related Documentation

- [Predicate Programming Guide](apple-archive/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html.md)

### Creating an Expression

- [init(format:argumentArray:)](foundation/nsexpression/init(format:argumentarray:).md)
- [init(format:arguments:)](foundation/nsexpression/init(format:arguments:).md)
- [init(format:_:)](foundation/nsexpression/init(format:_:).md)
- [init(coder:)](foundation/nsexpression/init(coder:).md)
