AutoLens

public protocol AutoLens : AutoOptics

Protocol for automatic derivation of lenses.

  • lens(for:) Extension method

    Generates a Lens for the field indicated by its key path.

    Declaration

    Swift

    static func lens<T>(for path: WritableKeyPath<Self, T>) -> Lens<Self, T>

    Parameters

    path

    Key path identifying the field where the Lens focuses.

    Return Value

    A Lens focusing in the field.