Generic Instance Method


Returns a view wrapping self that transforms the value of the environment key described by keyPath by applying a transform function.


func transformEnvironment<V>(_ keyPath: WritableKeyPath<EnvironmentValues, V>, transform: @escaping (inout V) -> Void) -> some View

See Also

Setting the Environment Values of a View

func environment<V>(WritableKeyPath<EnvironmentValues, V>, V) -> View

Returns a view wrapping self that sets a value for an environment keyPath.