---
title: KeyPath
framework: swift
role: symbol
role_heading: Class
path: swift/keypath
---

# KeyPath

A key path from a specific root type to a specific resulting value type.

## Declaration

```swift
class KeyPath<Root, Value>
```

## Overview

Overview The most common way to make an instance of this type is by using a key-path expression like \SomeClass.someProperty. For more information, see Key-Path Expressions in The Swift Programming Language.

## Relationships

### Inherits From

- [PartialKeyPath](swift/partialkeypath.md)

### Inherited By

- [WritableKeyPath](swift/writablekeypath.md)

### Conforms To

- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Key Paths

- [PartialKeyPath](swift/partialkeypath.md)
- [AnyKeyPath](swift/anykeypath.md)
