NavigationStack - SwiftUI Programmatic Navigation - iOS 16

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 พ.ย. 2024

ความคิดเห็น • 99

  • @IamTheGreatCornholioo
    @IamTheGreatCornholioo 6 หลายเดือนก่อน +17

    Finally someone who explains how to pass data to the view instead of just creating a simple item list

    • @seanallen
      @seanallen  6 หลายเดือนก่อน +3

      Glad you liked it.

    • @jehanpoplife
      @jehanpoplife 5 หลายเดือนก่อน

      I swear

  • @csmac3144a
    @csmac3144a ปีที่แล้ว +39

    Sean you deserve every bit of success you've achieved. You're a talented communicator, and it's obvious you put an enormous amount of work into each piece of content to maintain a high level of quality and consistency. Keep it up!

  • @timotejmatlak4625
    @timotejmatlak4625 8 หลายเดือนก่อน +2

    Sean, I really appreciate your work, you can explain complex things in the simplest way ever. Love it...

    • @seanallen
      @seanallen  8 หลายเดือนก่อน

      Thanks for the kind words :)

  • @ArchangelMichael94
    @ArchangelMichael94 5 หลายเดือนก่อน +3

    I can't remember the last time I had to slow the playback speed of a video to be able to process it 😅 Loved the vid, jam-packed with good stuff

    • @seanallen
      @seanallen  4 หลายเดือนก่อน +2

      I do my best to respect the viewers time. Most people complain that I talk to fast tho...

  • @markaurelius61
    @markaurelius61 ปีที่แล้ว +6

    That was good, clear and helpful. All the view popping up in navigationDestination were in the same View struct though. How does it work when you have different structs? How do you pass the NavigationPath around?

  • @cristopherescorcia3276
    @cristopherescorcia3276 2 ปีที่แล้ว +4

    Hey Sean great video, I was checking the NavigationStack recently and what I did to have acces to the path in every view is to pass that path via the enviromentObject and put the modifier after the NavigationStack so every view inside the Stack had access to the path and can modified it, for that demo it worked for me

    • @seanallen
      @seanallen  2 ปีที่แล้ว +1

      Yes, there are a few different ways you can architect your app so you can have access to this path on different screens. I love the flexibility of this!

    • @rachitsharma8829
      @rachitsharma8829 2 ปีที่แล้ว

      Hi Sean, it is very good content.
      I have an questions, how to manage click on different sections like 20 or 40 sections then how can we manage childs wirh click

  • @ianrickey208
    @ianrickey208 ปีที่แล้ว +1

    Love your content and instruction. I am a Swift n00b and play your vids at 75% playback speed to follow along. Thanks for it all and when I get through your tutorials I'll subscribe to your courses. At 75% playback speed.

  • @heenaberiya2669
    @heenaberiya2669 ปีที่แล้ว +1

    great tutorial. But what would be best for login and logout functionality if we have auto login option till token expired?

  • @aliDaTeslayaaMan
    @aliDaTeslayaaMan 2 ปีที่แล้ว +12

    Awesome video, thanks for all the work you put into building the next generation of developers!

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      Happy to help, Ali 😀

  • @ilija.mihajlovic
    @ilija.mihajlovic ปีที่แล้ว +2

    Thanks Sean, I was looking for hours to debug my project. Your video and how you explain stuff helped a lot. Since day one you rock!

  • @cest102
    @cest102 ปีที่แล้ว +4

    Nice tutorial. Just what I needed. For popping to the root view we can just do path.removeAll() or path = [ ], rather than computing the count I think - slightly safer if it works.

    • @MiaYu
      @MiaYu ปีที่แล้ว

      can use path = .init() , not path.removeAll() nor path.removeLast()

    • @GS-XV
      @GS-XV 5 หลายเดือนก่อน

      @@MiaYu If you just wanted to be as compact as possible, that would be path = [ ]
      But path.removeAll() makes the clearest code, because you're indicating what you really want to do - you want to empty the Array.

  • @jaylensmith6308
    @jaylensmith6308 2 ปีที่แล้ว +1

    This was a good tutorial to understanding navigation stack. I never knew about the possibilities of using it with data compared to using navigation links

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      Yes, it opens up A LOT more possibilities.

  • @JemmaGuaney
    @JemmaGuaney 6 หลายเดือนก่อน

    3:06 : You need to enable a click effect so that user can visually see your mouse clicking.

  • @dhavalnena7386
    @dhavalnena7386 ปีที่แล้ว +1

    Great tutorial so far!! Glad to see how you managed different types of navigations with different types. Thank you!

    • @seanallen
      @seanallen  ปีที่แล้ว

      Glad you liked it!

  • @laurentbennis
    @laurentbennis ปีที่แล้ว

    This is by far the best tutorial on that subject thank you :)

  • @stelluspereira
    @stelluspereira 7 หลายเดือนก่อน

    excellent content, but could not find the section collapsible icon , I tried adding
    .listStyle(.sidebar) , would be nice to have collapsible chevron icon

  • @krishnavivek9254
    @krishnavivek9254 ปีที่แล้ว

    Sean, Great video to fellow developers.

  • @nileshjdarji
    @nileshjdarji ปีที่แล้ว +1

    This is such a nice tutorial. Thank you Sean.

    • @seanallen
      @seanallen  ปีที่แล้ว

      Glad you liked it, Nilesh.

  • @paulikhane
    @paulikhane ปีที่แล้ว

    I like your teaching style

  • @bonifacy9511
    @bonifacy9511 ปีที่แล้ว

    @Sean Allen, great tutorial. Thank you. One question: How to add a custom back button? I would like to get rid of "< Back" in favor of "

  • @miguelgonzalez3329
    @miguelgonzalez3329 ปีที่แล้ว +1

    You are amazing Sean

  • @ulasina
    @ulasina ปีที่แล้ว

    Very good and fast tutorial.

  • @tariqAlmazyad
    @tariqAlmazyad 2 ปีที่แล้ว

    Beautiful explanation .
    I am still looking for a way to see if I could still use NavigationLink(isActive) with this new API .

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      I haven't experimented with that yet.

  • @Fddiferd
    @Fddiferd 7 หลายเดือนก่อน

    What do you do if you want to navigate to a settings page which doesn’t necessarily take a data object. Also when dealing with environment objects to you need to inject these into the navigation link?

  • @muradjam
    @muradjam ปีที่แล้ว

    Cool video thank you for you effort. However, is it possible to animate “pop to root” ?

  • @daniel.iosdev
    @daniel.iosdev 2 ปีที่แล้ว +1

    Amazing as always. Thank you Sean!

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      Glad you enjoyed it, Daniil

  • @Dragonboh1
    @Dragonboh1 ปีที่แล้ว

    Keep doing what you doing, man!

  • @marinadsf2248
    @marinadsf2248 ปีที่แล้ว

    Hi Sean, thx for your video, you save my time :) Have you some video to customize NavigationBar ? :)

  • @crocodiluQ2
    @crocodiluQ2 9 หลายเดือนก่อน

    what should one do if I want to use this for simpler cases, not lists.. Like I have a button, no data, and I just want to open another screen.

  • @justmytraining4190
    @justmytraining4190 4 หลายเดือนก่อน +1

    thank you for this video!

    • @seanallen
      @seanallen  4 หลายเดือนก่อน

      You're welcome!

  • @burakcankurtarr2751
    @burakcankurtarr2751 2 ปีที่แล้ว +1

    Amazing tutorial, thanks man!

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      Happy to help, Burak!

  • @adriangutierrez9812
    @adriangutierrez9812 ปีที่แล้ว

    Thank you very much for this! You were super easy to follow. Just subscribed. Can't wait to see more you have. Thanks again.

  • @aqibos
    @aqibos ปีที่แล้ว

    What if the next view isn't related to data, but rather an action? For example, a user logging in. Do I have to create a Hashable struct/object anyways?

  • @rillieux1792
    @rillieux1792 ปีที่แล้ว +1

    Just found this video - great stuff, and answered a ton of questions. Thanks! Of course, I'm left with the question - how does this work in a NavigationSplitView? I cannot for the life of me figure out where to put the .navigationDestination in a SplitView or if it's even possible to do so in one. Any tips for that?

    • @seanallen
      @seanallen  ปีที่แล้ว

      Glad you enjoyed it! I haven't worked with this in a SplitView yet, so I can't be of much help here unfortunately.

  • @grudev
    @grudev ปีที่แล้ว

    Awesome video and explanation as always, but i more and more ask myself one question: Are this pyramid of doom style of code really the new paradygm? Why people see this better or more beautiful than imperative style of code???

    • @seanallen
      @seanallen  ปีที่แล้ว

      The pyramid of doom in when the code is yet to be refactored. Once you refactor your views into components, the look of SwiftUI code becomes clean.

  • @meiowalot7570
    @meiowalot7570 2 ปีที่แล้ว

    I have dabbled in this stuff for a while and get so confused. Push/pop? Segue? Programmatically and/or wires up in the storyboards?

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      I can see how that could be. There are many ways to do things. Apple has been in a transition over the last few years with Swift and SwiftUI - so it can be confusing.

  • @omarelsayed6241
    @omarelsayed6241 ปีที่แล้ว

    I am learning iOS developing (beginner), Should I learn the navigation view first and focus on that, then see the lates updates and understand it ?

    • @omarelsayed6241
      @omarelsayed6241 ปีที่แล้ว

      and does this means that I shouldn't use navigationView anymore?

  • @zeroh_chill2966
    @zeroh_chill2966 9 หลายเดือนก่อน

    A year behind, but does anyone know why path.append doesn’t do anything for any of the 3 buttons? Maybe the path.append is no longer the correct method to use in SwiftUI?

  • @ArchitectDorukhanDemir
    @ArchitectDorukhanDemir ปีที่แล้ว

    Thanks Sean it was clear ❤

  • @eduardofulgencio741
    @eduardofulgencio741 10 หลายเดือนก่อน +1

    Muy bueno este video. Mil gracias.

    • @seanallen
      @seanallen  10 หลายเดือนก่อน +1

      Happy to help!

  • @JustinHold
    @JustinHold ปีที่แล้ว

    Great video! I was wondering if it's possible to use .navigationDestination to jump to different Views like you can in TabView?

  • @mahinur_rahman
    @mahinur_rahman ปีที่แล้ว

    is navigationstack or programatic only for list?

  • @KFrench1123
    @KFrench1123 ปีที่แล้ว

    Thanks, Sean 👍👍

  • @discodolken
    @discodolken 2 ปีที่แล้ว +1

    Love your videos man! Easily explained and well made :)) Thanks

    • @seanallen
      @seanallen  2 ปีที่แล้ว

      Glad you like them, Nicolai!

  • @sarthakshrivastava5596
    @sarthakshrivastava5596 ปีที่แล้ว

    Somehow my entire section became a navigation link as a whole and now it goes through every platform before going back to the Gaming section
    Looking to debug this rn

  • @cashstills
    @cashstills 2 ปีที่แล้ว +3

    oh they're cookin now huh

  • @HarendraSharmaGwl
    @HarendraSharmaGwl ปีที่แล้ว +1

    very much helpful.

    • @seanallen
      @seanallen  ปีที่แล้ว

      Happy to help, Harendra

  • @homeoffice3524
    @homeoffice3524 ปีที่แล้ว

    I have a one question. If you know SwiftUI in decent level. Different views,multi screen designs and animations but that’s it. You don’t know swift backend part and networking. If it’s possible to get ui(front end) junior job?

    • @seanallen
      @seanallen  ปีที่แล้ว

      It's possible... but an iOS job where you ONLY do front end UI work is pretty rare. I've only heard of that at the larger FAANG companies... but it would be pretty tough to get hired at one of those places without knowing the "programming" side of things. Almost all iOS jobs will require more than just UI work.

  • @sadiq4906
    @sadiq4906 7 หลายเดือนก่อน

    Why don't you do simply like path = []? to pop to home?

    • @Fddiferd
      @Fddiferd 7 หลายเดือนก่อน

      I was wondering that to

  • @ConernicusRex
    @ConernicusRex ปีที่แล้ว

    I really hate navigation stack and wish they'd make it easier to dynamically display views like it was in UIKit. Navigation stacks make otherwise really nice iOS apps look like windows software.

  • @Notkdenben
    @Notkdenben 5 หลายเดือนก่อน

    Damn this was supposed to be simple but it confused the heck out of me still lol

  • @saeedul
    @saeedul 2 ปีที่แล้ว

    Bro give me advice. I am a student and I am starting new career in development area So I like tow technology Backend or App development which one is good. I mean which one For deeply learning and high learning Please give me advice . Thanks:) Your videos so good.

  • @Deadpool25mm
    @Deadpool25mm ปีที่แล้ว

    Thanks!

  • @easybusinessou
    @easybusinessou 2 หลายเดือนก่อน +1

    Great

  • @mahinur_rahman
    @mahinur_rahman ปีที่แล้ว

    you are awesome

  • @dmitriyobidin6049
    @dmitriyobidin6049 5 หลายเดือนก่อน

    The only problem is - it's only available in iOS 16...

    • @RubbanIftikhar
      @RubbanIftikhar 4 หลายเดือนก่อน

      Navigation Stack does not work in the beta version of Xcode?

  • @danstoian7721
    @danstoian7721 2 ปีที่แล้ว

    The fact that NavigationPath needs be type erased, in Swift 5.7, is kind of disappointing to be honest.

    • @seanallen
      @seanallen  2 ปีที่แล้ว +2

      Hopefully that can be improved upon in future updates. SwiftUI is a work in progress.

  • @zenithacademy4588
    @zenithacademy4588 ปีที่แล้ว

    Cannot find 'navigationstack' in scope, please help

    • @seanallen
      @seanallen  ปีที่แล้ว +3

      NavigationStack requires iOS 16. Make sure the minimum target on your project is iOS 16

  • @DavidShaw-dc4re
    @DavidShaw-dc4re ปีที่แล้ว +1

    I don't understand this concept at all. It makes no sense to me. I am used to clicking a link or button and calling up a new page. Why isn't it possible to have an action linked to a button or screen object that loads a view controller that displays the defined screen objects for rendering and attach events to the objects to drive functionality.

    • @Spacer-l3j
      @Spacer-l3j 8 หลายเดือนก่อน +1

      Maybe because this is SwiftUI and it's different from UiKit ? Get used to it and stop crying

  • @brpark72
    @brpark72 4 หลายเดือนก่อน

    Do you know that extreme liberal political ads are running on your videos? You should do better

  • @dollhouseguy
    @dollhouseguy ปีที่แล้ว +1

    great video mate!

  • @Kush_Daddy
    @Kush_Daddy ปีที่แล้ว

    Is there a way to use this navigationstack to automatically navigate to your next view? It seems like now when you want to navigate, you have to create a physical button or link to press and begin navigating to the next screen. However, you used to be able to use the navigation links isActive parameter and create an empty view ao that when the condition is met, you can automatically navigate without pressing anything Such as after a api call.

  • @ailo5026
    @ailo5026 2 ปีที่แล้ว

    Hi Sean I really find your videos very helpful! I appreciate it! I was wondering in Xcode in the interface builder storyboard I was trying to make a tic-tac-toe game. In an action I wanted when the user presses a button an X appears at a certain font size. I have looked for a long time around the internet and still couldn't find anything. I will be forever grateful if you could help me 😁.
    @IBAction func testX(_ sender: UIButton) {
    sender.titleLabel?.font = [UIFont withSize(75.0)];
    }
    I tried this it doesn't work.

  • @AndrewDChristie
    @AndrewDChristie 10 หลายเดือนก่อน +1

    Thanks!

    • @seanallen
      @seanallen  10 หลายเดือนก่อน

      Wow, thanks Andrew. I appreciate the generosity!