Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

get(_:default:)

Gets a value from the Extend storage falling back to the default value if it does not exist or cannot be cast to T.
func get<T>(_ key: AnyKeyPath, default d: T) -> T

Discussion

KeyPath-based alternative to get(_:default:).

let foo: Foo = extend.get(\MyType.Foo, default: defaultFoo)