Contents

pointer(to:)

Obtain a pointer to the stored property referred to by a key path.

Declaration

func pointer<Property>(to property: KeyPath<Pointee, Property>) -> UnsafePointer<Property>?

Parameters

  • property:

    A KeyPath whose Root is Pointee.

Return Value

A pointer to the stored property represented by the key path, or nil.

Discussion

If the key path represents a computed property, this function will return nil.