NavigationStackController
final class NavigationStackController : ObservableObject
This navigationStack object heps to navigate between the views.
-
Path var stores the views in an array
Declaration
Swift
@Published var path: [NavigationDestination] { get set }
-
This function push the view on the navigationDestination array. Params: Takes the view which we want to navigate to.
Declaration
Swift
func push(to view: NavigationDestination)
-
This function helps to remove all the view from the array so that we can direcly go to the root view.
Declaration
Swift
func popToRoot()
-
This function removes the last view from the array
Declaration
Swift
func pop()