---
title: keyPath
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsexpression/keypath
---

# keyPath

The key path for the expression.

## Declaration

```swift
var keyPath: String { get }
```

## Discussion

Discussion Accessing this property raises an exception if it is not applicable to the expression.

## See Also

### Getting Information About an Expression

- [arguments](foundation/nsexpression/arguments.md)
- [collection](foundation/nsexpression/collection.md)
- [constantValue](foundation/nsexpression/constantvalue.md)
- [expressionType](foundation/nsexpression/expressiontype-swift.property.md)
- [NSExpression.ExpressionType](foundation/nsexpression/expressiontype-swift.enum.md)
- [function](foundation/nsexpression/function.md)
- [operand](foundation/nsexpression/operand.md)
- [predicate](foundation/nsexpression/predicate.md)
- [left](foundation/nsexpression/left.md)
- [right](foundation/nsexpression/right.md)
- [variable](foundation/nsexpression/variable.md)
