wrappedValue
The current value of the environment property.
Declaration
var wrappedValue: Value { get }Discussion
The wrapped value property provides primary access to the value’s data. However, you don’t access wrappedValue directly. Instead, you read the property variable created with the Environment property wrapper:
@Environment(\.colorScheme) var colorScheme: ColorScheme
var body: some View {
if colorScheme == .dark {
DarkContent()
} else {
LightContent()
}
}