AutoOptics

public protocol AutoOptics

Base protocol for optics automatic derivation.

  • copy(with:for:) Extension method

    Creates a copy of this object, replacing the value at the given key path by the provided value.

    Declaration

    Swift

    func copy<T>(with value: T, for path: WritableKeyPath<Self, T>) -> Self

    Parameters

    value

    New value for the field in the copy.

    path

    Key path of the field that will be modified in the copy.

    Return Value

    A copy of this value with the modified field.