AutoGetter

public protocol AutoGetter : AutoOptics

Protocol for automatic derivation of Getter optics

  • getter(for:) Extension method

    Generates a Getter for the field given by the key path.

    Declaration

    Swift

    static func getter<T>(for path: KeyPath<Self, T>) -> Getter<Self, T>

    Parameters

    path

    Key path of the field.

    Return Value

    A Getter optic focused on the provided field.