How to navigate using button with condition check in SwiftUI
问题 Since NavigationButton isn't available anymore, how do I check conditions in NavigationLink in order to navigate to another view? NavigationLink(destination: Dashboard(userName: self.userId, password: self.password), isActive: $showDashboard) { Button(action: { if self.userId.isEmpty || self.password.isEmpty { self.isAlert = true } else { self.showDashboard = true } }) { Text("Submit") .foregroundColor(.white) .font(.system(size: 22)) Dashboard() } .frame(minWidth: 150, idealWidth: 300,