Generic Instance Method

environment(_:_:)

Sets the environment value indicated by a key path to the given value.

Declaration

func environment<V>(_ keyPath: WritableKeyPath<EnvironmentValues, V>, _ value: V) -> some View

See Also

Setting the Environment Values of a View