I worked to a login view, now I want to present the view after login, but I do not want the user to have the possibility to return to the login
I made this extension for myself. Any feedback/ideas are welcome. :)
https://github.com/klemenkosir/SwiftUI-FullModal
struct ContentView: View {
@State var isPresented: Bool = false
var body: some View {
NavigationView {
Button(action: {
self.isPresented.toggle()
}) {
Text("Present")
}
.navigationBarTitle("Some title")
}
.present($isPresented, view: ModalView(isPresented: $isPresented))
}
}
struct ModalView: View {
@Binding var isPresented: Bool
var body: some View {
Button(action: {
self.isPresented.toggle()
}) {
Text("Dismiss")
}
}
}