transformEnvironment
Transforms the environment value of the specified key path with the given function.
View ModifieriOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+transformEnvironment(_:transform:) in SwiftUI
Declaration
compose().transformEnvironment<K extends keyof SwiftUI.EnvironmentValuesWritable>(
keyPath: K,
options: {
transform: SwiftUI.EnvironmentValuesWritable[K];
}
)nonisolated func transformEnvironment<V>(
_ keyPath: WritableKeyPath<EnvironmentValues, V>,
transform: @escaping (inout V) -> Void
) -> some ViewParameters
keyPath*Koptions.transform*SwiftUI.EnvironmentValuesWritable[K]
See also
More in State and environment.