How to make a NavigationStack return to its root view - Navigation SwiftUI Tutorial 5/9

Sdílet
Vložit
  • čas přidán 8. 11. 2023
  • Download the completed project here: github.com/twostraws/hackingw...
    Other parts in Project 9:
    Introduction: www.hackingwithswift.com/book...
    1. The problem with a simple NavigationLink: • The problem with a sim...
    2. Handling navigation the smart way with navigationDestination(): • Handling navigation th...
    3. Programmatic navigation with NavigationStack: • Programmatic navigatio...
    4. Navigating to different data types using NavigationPath: • Navigating to differen...
    5. How to make a NavigationStack return to its root view programmatically: This video
    6. How to save NavigationStack paths using Codable: • How to save Navigation...
    7. Customizing the navigation bar appearance: • Customizing the naviga...
    8. Placing toolbar buttons in exact locations: • Placing toolbar button...
    9. Making your navigation title editable: • Making your navigation...
    Wrap up and challenges: www.hackingwithswift.com/book...
    You can find the full set of videos, along with transcriptions, challenges, tests, and more, in my free 100 Days of SwiftUI course: www.hackingwithswift.com/100/...
    Watch the full 100 Days of SwiftUI playlist here: • 100 Days of SwiftUI (i...
  • Věda a technologie

Komentáře • 5

  • @vie-Tung
    @vie-Tung Před 6 měsíci +1

    Video very useful for fresher like me !

  • @roshanekka9687
    @roshanekka9687 Před 3 měsíci

    really need this, thanks

  • @ssaguiar
    @ssaguiar Před měsícem

    Hi, thanks for yours videos, they are helping me a lot. One question, if possible: and how can I do to return to root view when it calls another view which calls another view, and so on, as in menus which displays views? For example, my main view has a button which display a menu and the menu has several buttons to show other menu's views. So, how to return from one of those sub views to the root one? Thanks a lot.

  • @ryanlertola
    @ryanlertola Před 2 měsíci

    Why not put the toolbar on the DetailView that's in the navigationDestination? You wouldn't need the binding, and it would only show the Home button when it's not on the home screen. Is it not proper to do this?

  • @user-cy4jg4ip2w
    @user-cy4jg4ip2w Před 2 měsíci

    Could you please tell us why home button will be there once we remove all the paths?