Is it at all possible to use an actionSheet with navigationView? I want clicking a button in an actionSheet to take them to a new view.
.actionSheet(isPresented: $showingActionSheet) {
ActionSheet(title: Text("Login"), message: Text("Choose how to login"), Buttons: [
.default(Text("Email and Password")) {
//Navigate somewhere using NavigationView
}
Edit: Was told to do this, but still not working
.actionSheet(isPresented: $showingSheet) {
ActionSheet(title: Text("Login With:"), message: Text("Choose how to login"), buttons: [
.default(Text("Email")) { self.navigateTo = "emaillogin" },
.default(Text("QR Code")) { self.navigateTo = "QR" },
.default(Text("Key")) { self.navigateTo = "keylogin" },
.default(Text("Text")) { self.navigateTo = "textlogin" },
.cancel()
])
}
.background(
NavigationLink(destination: Text(self.navigateTo), isActive: $isActive) {
EmptyView();
})