Search code examples
iosswiftuiswiftui-navigationlink

How to push to next view in the Navigation stack after the api call in SwiftUI?


I have a NavigationView and after the api call i need to push to the nextView (I don't want to use the ZStack because i should be able to perform push and pop operation after this).


Solution

  • In my case, I use NavigationLink(destination: YourNextView(), isActive: Binding) to achieve my ideal application process. After using NavigationLink(destination: ,isActive:), I still can use Alert or Popover. Hence, I think that you can try this. Click here for more information about NavigationLink