0

I have a problem: I don´t know how to implement a NavigationLink into a Button -> I want to create a Button named "Order now" for a shopping app. Depending on the payment that was chosen by the user I want to show different views after the user clicks on the button.

  Button(action: {
                    if self.cart.orders.count > 0 {
                        switch self.paymentOption {
                        case 0:


                        default:
                            break
                        }
                    } else {
                        self.confirmationAlert.toggle()
                    }
                   }) {
                       Text("Order now")
                   }

Thanks for your help in advance!

  • Does this answer your question? [Use NavigationLink programmatically in SwiftUI](https://stackoverflow.com/questions/57889990/use-navigationlink-programmatically-in-swiftui) – Asperi Feb 02 '20 at 14:07
  • Does this answer your question? [SwiftUI NavigationLink: Navigate to a destination view AFTER running account creation code successfully](https://stackoverflow.com/questions/57697827/swiftui-navigationlink-navigate-to-a-destination-view-after-running-account-cre) – gotnull Feb 02 '20 at 14:16

0 Answers0