---
title: "value(forKeyPath:)"
framework: objectivec
role: symbol
role_heading: Instance Method
path: "objectivec/nsobject-swift.class/value(forkeypath:)"
---

# value(forKeyPath:)

Returns the value for the derived property identified by a given key path.

## Declaration

```swift
func value(forKeyPath keyPath: String) -> Any?
```

## Parameters

- `keyPath`: A key path of the form relationship.property (with one or more relationships); for example “department.name” or “department.manager.lastName”.

## Return Value

Return Value The value for the derived property identified by keyPath.

## Discussion

Discussion The default implementation gets the destination object for each relationship using value(forKey:) and returns the result of a value(forKey:) message to the final object.

## See Also

### Related Documentation

- [setValue(_:forKeyPath:)](objectivec/nsobject-swift.class/setvalue(_:forkeypath:).md)

### Getting Values

- [value(forKey:)](objectivec/nsobject-swift.class/value(forkey:).md)
- [dictionaryWithValues(forKeys:)](objectivec/nsobject-swift.class/dictionarywithvalues(forkeys:).md)
- [value(forUndefinedKey:)](objectivec/nsobject-swift.class/value(forundefinedkey:).md)
- [mutableArrayValue(forKey:)](objectivec/nsobject-swift.class/mutablearrayvalue(forkey:).md)
- [mutableArrayValue(forKeyPath:)](objectivec/nsobject-swift.class/mutablearrayvalue(forkeypath:).md)
- [mutableSetValue(forKey:)](objectivec/nsobject-swift.class/mutablesetvalue(forkey:).md)
- [mutableSetValue(forKeyPath:)](objectivec/nsobject-swift.class/mutablesetvalue(forkeypath:).md)
- [mutableOrderedSetValue(forKey:)](objectivec/nsobject-swift.class/mutableorderedsetvalue(forkey:).md)
- [mutableOrderedSetValue(forKeyPath:)](objectivec/nsobject-swift.class/mutableorderedsetvalue(forkeypath:).md)
