The Complete Guide to NavigationView in SwiftUI

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

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

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

    Thanks so much for the video! With the deprecation of NavigationView and release of NavigationStack, are you planning a similar video for the Stack variant and new way of working with Navigation?

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

    2 days of struggle and your video solved my issue in first 1 min and 43 sec. Thank you sir!!!

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

    Great tutorial and I especially like the workarounds you came up with to allow us to keep the same code between platforms. However, when you build the watchOS version at 35:26, you haven't re-inserted the NavigationView code in the main ContentView to demonstrate that the struct has "fixed" the watchOS limitation.

  • @arnoczkyzoltan6158
    @arnoczkyzoltan6158 4 ปีที่แล้ว

    There are no more ‘h’ in the world, you used it all :) Great video, by the way. Thank You!

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

    Excellent tutorial. I always learn so much when I watch your videos.

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

    Dear Mr.Hudson, thank you very much indeed for this tutorial. I've been on the UIKit before, and before seeing this tutorial, I have struggled to comprehend the navigation concept in SwiftUI. Now it's crystal clear to me - thanks to your kind help!

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

    Perfect timing! All I've been seeing online lately are endless complaints re: nav in SwiftUI.

  • @hyounoosung7600
    @hyounoosung7600 4 ปีที่แล้ว

    Thanks to this video, I could finally finish my authentication flow navigation where protected tab to redirect to signIn page!!

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

    I started to watch all of your videos, all are great and really helpful, one question on this video, at 17:35 timeline, why @ObservedObject is used, in an another video you advised to use the @StateObject instead of @ObservedObject while creating the object, and use @ObservedObject only while passing data. Hope you will clarify this to me, and thanks in advance

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

    You are made out of greatness. Thank you for the tutorials.

  • @DavidNitzscheBell
    @DavidNitzscheBell 3 ปีที่แล้ว

    12:20 I don't understand why/when we'd use this. Is this just another way of doing the same thing you showed before, or is this required for certain situations? If so, *which* situations? That's not at all clear.

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

    Good stuff paul, I wish you went deeper into advanced stuff like "tag", popping back to root..ect

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

    Thank you so much for making this video, I learned a lot of stuff that I needed. I owe you this one!

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

    Thank you, Paul! This material is very helpful. But I have a question, it is possible to set attributes for buttons as well? I want to change color of backButton, it shall be different for scrollEdgeAppearance and standardAppearance in my case. Thank you in advance, regards.

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

    Awesome guide to NavigationView in SwiftUI, Paul! Thanks for sharing.

  • @ZinzingGo
    @ZinzingGo 4 ปีที่แล้ว

    Paul you're the king.

  • @HuyLe-hn9le
    @HuyLe-hn9le 3 ปีที่แล้ว

    You are incredible. Thank you sir ,we love you

  • @alexanderfitterling
    @alexanderfitterling 3 ปีที่แล้ว

    your courses are awesome!! keep going!

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

    This is great! Do you know if with SwiftUI you can keep open the primary view for iPad when having the master/detail views? Thanks!

  • @zeryez6347
    @zeryez6347 4 ปีที่แล้ว

    Thanks for this Video helped me a lot
    its like my head can't check all the things you're sharing, so I will needed to come back to rewatch
    Wish you the best and stay active this Videos help a lot for everybody and nice and simple explanations great Job

  • @olepetersen4460
    @olepetersen4460 4 ปีที่แล้ว

    Many thanks for your comprehensive tutorials. Really good!

  • @ElGualdo
    @ElGualdo 3 ปีที่แล้ว

    Hi!!! As always awesome content I have a question, let's suppose I have navigation of 3 consecutive views, view 1 -> view 2 -> view 3, and being in the view 3 how can I perform a popToRootViewController in swiftUI so I can get to view 1

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

    What great timing Paul. I have been going over this for a couple days now,, thank you. Are you hacking my computer? If you are great job! Lol. I am wondering how I take this knowledge and when I navigate to the second screen instead of the simple text views import PDF or JSON data.

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

    You're a legend. Keep it up!

  • @celmarostaff
    @celmarostaff 4 ปีที่แล้ว

    Great and informative like always but is there a way to hide the primary view and keep only the secondary on screen in a Catalyst app on macOS. Like Reminder is doing it if you resize the primary view to zero.

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

    Fantastic video. Just transitioning to SwiftUI, so this is extremely helpful. Just one minor oversight in your video in the WatchOS example at 35:30. You made a nice wrapper to take care of the fact that watchOS doesn't support NavigationView. Unfortunately, just before you created your watchOS-specific NavigationView, you deleted the NavigationView from the body of your ContentView example. In other words, you didn't use the wrapper you created. I'm sure it would have worked, though!
    Also, I'm a little confused about your macOS example. You got the macOS version of the code to compile by implementing the navigationBarTitle modifier, but that implementation does nothing. Presumably, you want to do something with that title. If you wanted to simply remove the offending modifier, I think you just wrap the modifier with the conditional compiling without having to create an extension.

  • @apptouchtechnologies3722
    @apptouchtechnologies3722 3 ปีที่แล้ว

    Does SwiftUI have a way to drag and drop UI comps to quickly learn the basic elements? Learning Swift UI now, live preview is nice but it’d be nice to drag and quickly see what the different controllers / controls do and how they look.

  • @asigivati1382
    @asigivati1382 4 ปีที่แล้ว

    I really like your videos!
    I don't understand why to use EnvironmentObject when i can just use a singleton managers like "UserManager.shared.score" without passing any data between the views.
    The UserManager.shared.score variable can be @Published type and thats it, no?

  • @drummerjim
    @drummerjim 4 ปีที่แล้ว

    Is there a way to replace the title text (on the parent page) with an image, but keep the navigation link button appearing on the child page to return you back to the parent page?

  • @jeffsherin9564
    @jeffsherin9564 11 หลายเดือนก่อน

    NavigationLink with isActive is deprecated now. Is there an updated video?

  • @barche75
    @barche75 4 ปีที่แล้ว

    Thank you Paul. How do you find such things? Is there any way to create nav bar title views? Or it not exists in SwiftUI and we must draw all manually?

  • @dewigesrek5651
    @dewigesrek5651 3 ปีที่แล้ว

    Is it possible to remove the default top navigation space ? Thanks

  • @udesai2011
    @udesai2011 3 ปีที่แล้ว

    Is transcript for the video available.

  • @juanmanuelgentili2152
    @juanmanuelgentili2152 3 ปีที่แล้ว

    Amazing. Super complete!

  • @hsksearch3
    @hsksearch3 3 ปีที่แล้ว

    How if I would like. .navigationViewStyle(DoubleColumnNavigationViewStyle()) and make portrait view to show 2 columns as same as landscape view on iPad ? thankssss ^^ please help

  • @sumupitchayan
    @sumupitchayan 4 ปีที่แล้ว

    Is there a reason you use the XCode Simulator instead of the live preview in Canvas?

  • @ZiyanJunaideen
    @ZiyanJunaideen 3 ปีที่แล้ว

    Love your videos... ❤️
    Very detailed, no BS!

  • @brucknerdevilliers
    @brucknerdevilliers 4 ปีที่แล้ว

    Paul, With Xcode12 beta, AppDelegate is no longer available, so I am confused how we tackle to the navigation bar attributes.

  • @crisag.2698
    @crisag.2698 4 ปีที่แล้ว

    Thanks for this awesome video. I am trying to create a login screen with colored background. I have 2 buttons in my login view in a Vstack, and that Vstack sits within the NavigationView. When I try to give my Vstack a background color, the background of the VStack doesn't take up the entire screen. It seems like the navigation view is hogging space at the top of the screen. Do you know how to stop this? I can't find any documentation on it.

    • @tahmidazam639
      @tahmidazam639 4 ปีที่แล้ว

      Use a Zstack with the colour and the navigation view

  • @jwkranenburg
    @jwkranenburg 4 ปีที่แล้ว

    Hi Paul is there a "shimmy" ? for detecting an iPad or an iPhone? or would it be better to write 2 SwiftUI files - one for each device type?

  • @jason_bourne17
    @jason_bourne17 4 ปีที่แล้ว

    Hello sir!
    how navigate back to a specific view?
    A->B->C->D->B

  • @calebhansen9316
    @calebhansen9316 4 ปีที่แล้ว

    Is there a quicker way to embed in NavigationView like there is with embed in HStack, etc.?

  • @paulorodrigues8475
    @paulorodrigues8475 3 ปีที่แล้ว

    How can I navigate by click on the image from example?

  • @petersuvara
    @petersuvara 4 ปีที่แล้ว

    Hey Paul, do you have an update for the Swift UI 2 new NavigationTitle and associated styling, NavigationBarTitle has been deprecated.

  • @docendodisco-it
    @docendodisco-it 4 ปีที่แล้ว

    It is a very good video but there is an interesting point which is not addressed I think. How do we programmatically go back?

  • @judy8821
    @judy8821 4 ปีที่แล้ว

    Wonderful! I always learn something new thanks to you.

  • @bibinjacob123
    @bibinjacob123 4 ปีที่แล้ว

    I tried programmatically popping from the details view to the main view. But, when I implement that the back navigation on the top does no longer work.

  • @blueducktrading
    @blueducktrading 3 ปีที่แล้ว

    Hi Paul, thanks for the content. I just wanted to say that the micro phone static is a tad off putting, every time you chat it crops up.

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

      It's actually the fan from my MacBook Pro - it runs hot because of Xcode, plus screen capture, webcam, etc. I have switched out my mic since then, which ought to help 👍

    • @blueducktrading
      @blueducktrading 3 ปีที่แล้ว

      @@twostraws Awesome! Great content really enjoying it.

  • @Saltyyydog
    @Saltyyydog 4 ปีที่แล้ว

    You are awesome ! Thank you very much for this video 😃

  • @b0red7
    @b0red7 4 ปีที่แล้ว

    hey ... random question ... how can you make a clone of notion or taskade.com ?

  • @ebeytech
    @ebeytech 4 ปีที่แล้ว

    Amazing tutorials! Thanks for all your efforts in giving excellent examples.

  • @mig12394
    @mig12394 4 ปีที่แล้ว

    Always very interesting, a lot of new things to learn

  • @jigneshstratecore1336
    @jigneshstratecore1336 3 ปีที่แล้ว

    how can we hide back button in view

  • @jcj3582
    @jcj3582 4 ปีที่แล้ว

    Hi Paul,
    I've been trying to use a ZStack and NavigationView together. I'm using a Maps/Stocks drawer view that starts with the handle at the bottom of the screen and covers a NavigationView. The NavigationView behaves very strange when you do this. The navigationBarTitle and the buttons disappear. I figured out that they just got pushed up above the top of the screen. I ended up with a ZStack - VStack - Spacer - NavigationView - then the custom drawer view for the top of the ZStack. It kind of works.... Looks good on 11 Pro Max but doesn't fit the screen on the other devices and the drawer disappears . From what I have been able to figure out NavigationView should be at the top of the order but that doesn't work either. Any Ideas on how to make this work?

  • @rabinswalterraj2263
    @rabinswalterraj2263 4 ปีที่แล้ว

    how to access Observed object inside observable class

  • @FF7824
    @FF7824 4 ปีที่แล้ว

    Fantastic job. Thank you!!

  • @d7writes
    @d7writes 4 ปีที่แล้ว

    Fantastic video! 👍

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

    It helped me a lot!

  • @velomehr6845
    @velomehr6845 4 ปีที่แล้ว

    such an informative lesson - thank you very much!

  • @iphoneultra
    @iphoneultra 4 ปีที่แล้ว

    can you show us how to implement in-app subscription with free trial with revenuecat. bought your power pack but it doesn't have in-app-purhcase stuff at all !!

  • @StefanSteinbauer
    @StefanSteinbauer 4 ปีที่แล้ว

    Thank you Paul. awesome stuff

  • @insertacoin738
    @insertacoin738 3 ปีที่แล้ว

    just majestic

  • @thephantom1237
    @thephantom1237 3 ปีที่แล้ว

    thanks a lot for the video.

  • @somersmatthews2749
    @somersmatthews2749 3 ปีที่แล้ว

    why do swift youtubers never show link to source code in description?

  • @xinth23
    @xinth23 4 ปีที่แล้ว

    Paul, I love your videos. Can you also please do a video on how to type as fast as you? :-)

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

      That's me typing slowly! I only type fast when I'm a) using my mechanical keyboard, and b) not trying to narrate a 40-minute video in one take 😅

  • @luisgomezreus732
    @luisgomezreus732 4 ปีที่แล้ว

    Es un vídeo fantástico!!! Muchas gracias Paul

  • @juanjnino
    @juanjnino 4 ปีที่แล้ว

    Thanks! Learned a ton!

  • @yasenivanov6127
    @yasenivanov6127 4 ปีที่แล้ว

    Just perfect! Congratulations!

  • @sonjack7261
    @sonjack7261 3 ปีที่แล้ว

    How is "isActive" work ? I dont konw

  • @amielterence
    @amielterence 4 ปีที่แล้ว

    Bless you Sir.

  • @ZoeSummers1701A
    @ZoeSummers1701A 4 ปีที่แล้ว

    Why does “$selection work?

    • @syedmoamberraza1490
      @syedmoamberraza1490 4 ปีที่แล้ว

      when we use two way bind we have to use that $ sign with variable.

  • @maverickchan9552
    @maverickchan9552 4 ปีที่แล้ว

    always helpful !!!

  • @RobertBMenke
    @RobertBMenke 4 ปีที่แล้ว

    Great video!

  • @zaurmahmudov1438
    @zaurmahmudov1438 4 ปีที่แล้ว

    Hi there, love your channel. I enjoy every episode. However, that would be wonderful if you would have left the source code for the tutorial.

  • @Min-YiChen
    @Min-YiChen 3 ปีที่แล้ว

    Thank you so much , appreciate!

  • @cloudlee4231
    @cloudlee4231 4 ปีที่แล้ว

    Wow, thank you very much. How many hours should I do coding for, to write code without any googling like you?

  • @developer-juice-Khailenno
    @developer-juice-Khailenno 4 ปีที่แล้ว

    You are missing the case where I want to navigate to a new view WITHOUT the back button, thereby reseting the entire navigation stack. ie Loggin in, signing out.

  • @yazidali7071
    @yazidali7071 4 ปีที่แล้ว

    Amazing video.....

  • @burroughsjd
    @burroughsjd 4 ปีที่แล้ว

    Awesome stuff!

  • @fioktistwerner6706
    @fioktistwerner6706 4 ปีที่แล้ว

    TextEditor(text: $text)
    does not work in ScrollView !

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

    NavigationView is feeling very limiting...

  • @abrahamghaemi8895
    @abrahamghaemi8895 4 ปีที่แล้ว

    very helpfull tnx bro

  • @soheilpakgohar6630
    @soheilpakgohar6630 4 ปีที่แล้ว

    you are the best .....

  • @ZhengCheng
    @ZhengCheng 4 ปีที่แล้ว

    Thank you!

  • @ecptavares
    @ecptavares 4 ปีที่แล้ว

    Very Cool but I don't think this navigationBarTitle inside the NavigationView makes any sense at all.If you want it to change on the fly you should create some @State variable since swiftui introduce it.

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

    You had my full support until 30:53. That is absolutely horrendous default behavior and makes absolutely no logical sense. I can understand why that can be useful in some cases, but as the default and recommended way? You hurt my brain with that haha.

  • @TheYusuf10
    @TheYusuf10 4 ปีที่แล้ว

    The MAN...

  • @sknown
    @sknown 4 ปีที่แล้ว

    I tried to replicate the code for EnvironmentObject just like in the video, but cannot get it to work anymore. It complains that no ObservableObject of type User found. A View.environmentObject(_:) for User may be missing as an ancestor of this view.
    Did Apple change something since this video was published?
    Here's the code for the basic example I was testing: gist.github.com/thezealousfool/5b7ca821c478cffe180177cd748a3abd
    Can you please help? Thank You

  • @yours.trustworthy
    @yours.trustworthy 3 ปีที่แล้ว

    After 25:15 I understood, its not my cup of tea. Thanks

  • @thomasipad7719
    @thomasipad7719 3 ปีที่แล้ว

    Very interesting. But Apple should make sure that SwiftUI just can be used on all devices without change or additional platform code! This is still in a beta stage for me

  • @jorool1988
    @jorool1988 3 ปีที่แล้ว

    Great video, man! I still hate swift though. hahahahaha

  • @muazhassan_
    @muazhassan_ 4 ปีที่แล้ว

    Do same for UIKIT (swift) also and thanks for the content xd

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

    Hey, Paul - If you're gonna update, PLEASE, for the sake of anyone like me, who has no choice but to support older hardware (and therefore, older software, tools and coding practices) put the update *ALONGSIDE* the original, instead of junking and replacing the old version! That doesn't just apply to this vid - I'm also speaking of your material on the HWS website, which, granted, is some serious good stuff, but for those of us who don't or can't work exclusively on hardware (and therefore, software and tools) that's bleeding-edge-just-released-yesterday, losing the "old" tutorials and docs because they've been updated to this week's "latest and greatest" is a serious kick in the guts.

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

      All the old iOS 15 and even iOS 13 videos remain on TH-cam, SwiftUI by Example shows both new code and old code wherever possible, and folks who buy Hacking with iOS get both the new book and the old book as part of their purchase - it’s hardly what I’d call “junking and replacing.”

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

      @@twostraws You seem to have taken that as some sort of personal jab - That was NOT the intention. More of an observation that everybody and his dog who puts out tutorials, examples, and docs seems to be obsessed with punching out a new version every time Apple hints at a new software version number, and in the process, dumps us "not the blood dripping off the bleeding edge" folks like a hot rock.

  • @mrcodmansfriend
    @mrcodmansfriend 4 ปีที่แล้ว

    boom.

  • @ZoeSummers1701A
    @ZoeSummers1701A 4 ปีที่แล้ว

    SwiftUI syntax, layout and the idiosyncrasies are pathetic. I can’t believe Apple is behind this abomination.

  • @MatthewCoxTheReal
    @MatthewCoxTheReal 4 ปีที่แล้ว

    Love your tutorials, but this one is useless. Just does not align with all the other methods or tutorials on how to navigate or create views. Totally confusing. Thumbs down.

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

    AppDelegate.swift is no long created by XCode. Have to add the UINavigationBarAppearance codes in the "mainApp' file using init() {...}

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

    You never showed how to automatically move to a new view.