Generic Instance Method

appending(path:)

Returns a new key path created by appending the given key path to this one.

Declaration

func appending<Root, AppendedRoot, AppendedValue>(path: ReferenceWritableKeyPath<AppendedRoot, AppendedValue>) -> ReferenceWritableKeyPath<Root, AppendedValue>?

Parameters

path

The reference writeable key path to append.

Return Value

A key path from the root of this key path to the value type of path, if path can be appended. If path can’t be appended, returns nil.

Discussion

Use this method to extend this key path to the value type of another key path. Appending the key path passed as path is successful only if the root type for path matches this key path’s value type.