How to I apply a hueRotation
, blur
, or other effect to a control in SwiftUI and still allow users to interact with it?
import SwiftUI
struct SwiftUIView: View {
@State var isOn = true
var body: some View {
Toggle(isOn: $isOn) {
Text("The toggle is \(isOn ? "on" : "off")")
}
.padding()
.hueRotation(.degrees(60)) // <-- Disables interactivity
}
}
struct SwiftUIView_Previews: PreviewProvider {
static var previews: some View {
SwiftUIView()
}
}