Returns a new key path created by appending the given key path to this one.
- Xcode 9.3+
- Swift Standard Library
The key path to append.
A key path from the root of this key path and the value type of
path can be appended. If
path can’t be appended, returns
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. This example creates key paths from
String and from
Int, and then tries appending each to the other:
The second call to
nil because the root type of
Array<Int>, does not match the value type of