I'm unable to use logical not
!operator with Bindable$object.
Here is the scenario I want-
struct ContentView: View {
@State private var isLoggedIn:Bool = true
var body: some View {
Text("Root View")
.sheet(isPresented: !self.$isLoggedIn) {
SignInView()
}
.onAppear { self.performAuthentication() }
}
}
Sign In View should present as soon as I set isLoggedIn = false by some button action. For which I have to use logical not operator before $.
Compiler error: Cannot convert value of type 'Binding' to expected argument type 'Bool'
How can I achieve this?