How to use @ViewBuilder in SwiftUI | Advanced Learning #9

Поділитися
Вставка
  • Опубліковано 22 сер 2024

КОМЕНТАРІ • 75

  • @ismailMerced
    @ismailMerced Рік тому +3

    I love how Nick give us the problem and then introduce us to the solution

  • @nagornik
    @nagornik 2 роки тому +10

    I'm learning Swift and I have a few resources where I get information from. You're definitely the best! Sometimes instead of googling I just watch your video about some technology or something and it's much more informative because of the way you explain stuff with examples. When I become a fancy developer I owe you a beer, man. You're awesome! Thank you for what you do.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +4

      Thanks man! Good luck on your coding journey 🚀🚀

  • @Pepe_the_raver
    @Pepe_the_raver 10 місяців тому

    Following this course means jumping to a whole new level of coding with SwiftUI, I simply love it!

  • @Notkdenben
    @Notkdenben 2 місяці тому

    Im in awe of how this lines up. I’ve been struggling to understand swiftUI sort of “under the hood”. I can understand why this is in advanced learning, but I really wish I could’ve had this puzzle piece around the same time I was being introduced to swiftUI view components. This is a really interesting concept.

  • @deterligegyldigt
    @deterligegyldigt 2 роки тому +2

    If I don't add the @ViewBuilder in the init it still seems to work. The important part to note about viewBuilder is that it allows for multiple subviews.
    If you remove the VStack in "Generic 3" sample, it proves the point better: without the @ViewBuilder, the compiler complains, with it, it behaves like a VStack

  • @CookJapanChannel
    @CookJapanChannel 2 роки тому +5

    When you like Nick's video before even watching it.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +3

      Haha I love that 🥰 Thanks for watching!!

    • @Dorothyinstead
      @Dorothyinstead 2 роки тому

      Hahaha, have only just begun to watch Nicks basic tutorials on SwiftUI. But am sure, in time, I will be going through these more advanced videos. I like his style and clarity.

  • @tambui3603
    @tambui3603 7 місяців тому +1

    From Vietnam, Thanks a lot for your amazing contents. Can't wait for your next swift ui courses

  • @RK-wg7wr
    @RK-wg7wr 2 роки тому +1

    Just finished watching all your playlists. Thank you for the great contents!!

  • @josemanuelortizsanchez4983
    @josemanuelortizsanchez4983 Рік тому

    I wish I had known earlier about using @ViewBuilder in conjunction with computed variables of type some: View.
    Thanks, this is going to improve the code of my applications a lot.

  • @aaronr2248
    @aaronr2248 2 роки тому +4

    Another phenomenal video, Nick. Thank you for taking the time to put together such helpful and well demonstrated videos. Top quality stuff.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +1

      Thanks for watching! Glad you're enjoying the content.

  • @sols.2525
    @sols.2525 2 роки тому +2

    Awesome video and series Nick. This is some powerful stuff. I don't even know how you learned all this stuff but I have taken paid courses in the past and you have hands down the best stuff I have seen.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +2

      Thank you Scott! I have taken many of those courses as well and it's actually a big part of the reason I started this channel. I felt that most of the SwiftUI courses weren't really teaching the topics, but rather just making an app and having students copy the code. Anyway, glad you're enjoying the channel. 🥳

  • @nyangkkun2
    @nyangkkun2 Рік тому

    와 정말 소리질렀어, 넌 최고야. It was a really difficult concept to understand, but now I got it. Thank you so much

  • @erdemsenol9642
    @erdemsenol9642 2 роки тому +7

    Nick you are a really great developer and teacher. Your content is amazing, thank you. But we really grasp what we learn better by building whole apps, like we have done in the coin app you built. I will suggest you 2 topics and I would be grateful if you consider them. 1) I have difficulties about finding a complete tutorial for swiftui-mapkit integration(not only showing user location, but also showing area of interests, making custom annotations and marking the map so that other users can see, search and pin locations etc.). And secondly, building apps based on an api using async functions and asyncImage feature has some unclear areas for most of the developers. Can you focus one of the issues on your next tutorial series please?

    • @erdemsenol9642
      @erdemsenol9642 2 роки тому

      And please post new courses in UDEMY, I will definitely buy whatever you put out there.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +8

      Hello! Thanks for watching :) After I finish this bootcamp playlist, I will be adding another course where we build a whole app. I try to always do bootcamp videos before the course so that the code in the course makes more sense and people can refer back to the bootcamp vids if they get stuck!
      I will definitely add to my list a few videos for integrating MapKit, great suggestion.
      However, I won't be using async functions in my next app though because async is only available for iOS 15 and is not backwards compatible. Most production apps will be supporting iOS 14 for at least another year or two, so it's not very realistic to use yet. I'll do some bootcamp videos on it soon.

    • @erdemsenol9642
      @erdemsenol9642 2 роки тому +1

      @@SwiftfulThinking you are amazing. Thank you!

  • @mhfs61
    @mhfs61 2 роки тому +1

    Thank you, Nick. Very helpful 👍🏼👍🏼👍🏼

  • @Simon-zy9mb
    @Simon-zy9mb 2 роки тому +1

    I like it Nick. This is a great course!

  • @magedmohmed4403
    @magedmohmed4403 10 місяців тому

    Thanks a lot nick , you are perfect in explanation

  • @glorytoukraine6956
    @glorytoukraine6956 2 роки тому +1

    Awesome explanation! Thank you!

  • @edwardjob1437
    @edwardjob1437 2 роки тому

    Really great great great SwiftUI tutorial videos I ever watched. The author is absolutely a great developer and teacher.

  • @tutecodes3631
    @tutecodes3631 Рік тому

    Really helpful content Thank you so much

  • @alexl2512
    @alexl2512 6 місяців тому

    Exactly what I want to learn about @ViewBuilder.

  • @selvarajant
    @selvarajant Рік тому

    Simple and clear explanations. Thanks

  • @PLawesomeness
    @PLawesomeness Рік тому

    This playlist is so good. Thank you!

  • @rudra003
    @rudra003 Рік тому

    very well detailed explanation Nick, thank you 👍

  • @LebenWerden
    @LebenWerden 2 місяці тому

    Well done explained.

  • @toastrecon
    @toastrecon Рік тому

    Thanks! Lots of great info!

  • @lukassbeataddicts
    @lukassbeataddicts 2 роки тому +2

    How awesome. Thanks

  • @JZ-xc8hu
    @JZ-xc8hu Рік тому

    this video is very useful and understand for beginer

  • @denisk3852
    @denisk3852 2 роки тому +1

    Great 👍

  • @Stricken174
    @Stricken174 Рік тому

    Wonderful explanation!

  • @bhuwin6186
    @bhuwin6186 2 роки тому

    Amazing

  • @EnisTola
    @EnisTola Рік тому

    thank you so much. such a helpful tutorial, learned a lot 🙏

  • @sureshkumar-yy5lf
    @sureshkumar-yy5lf Рік тому

    It's really informative and explanation is very good with examples. Only thing i have suggestion is to keep the example code, so that it will be really helpful.

  • @dart-lin3571
    @dart-lin3571 2 роки тому

    Thank you very much.

  • @franklemur5518
    @franklemur5518 Рік тому

    I realize I am coming to this a year after posting but it is still VERY relevant and USEFUL. The music is a little unusual but if that what you like then who am I to comment. Seriously, this is good stuff are you going to release /update for ios16 new features/changes?

  • @TCakes
    @TCakes Рік тому

    I use @viewbuilder all the time, thanks to the youtuber Kavsoft. I think it makes the code very clean and easy to navigate, especially with child views you do not plan to reuse.

  • @user-wm9lq4fd8i
    @user-wm9lq4fd8i 2 роки тому

    amazing tutorial! appreciate!

  • @danielcrompton7818
    @danielcrompton7818 Місяць тому

    Hi Nick thanks so much as usual fir great free content! Definitely worth the like and subscribe!! I have a question though, why do you need the @Viewbuilder and why can’t you just have the closure to return contrnt?

  • @katesychenko
    @katesychenko 2 роки тому +1

    Thank you!

  • @Lammax2012
    @Lammax2012 Рік тому

    Thanks!

  • @andresraigoza2082
    @andresraigoza2082 2 роки тому

    So cool, Thank you so much!!!

  • @korges2590
    @korges2590 2 роки тому

    I really like your content. For me you are the best source of Swift learing materials. I've big request for you. Could you please create some tutorial how to organize package structure in big iOS apps? Multiple screens, widgets, database and so one. Thanks :)

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому

      Hi Korges! Thanks for the comment. That's a really broad question because every app is different and the files should be organized for the specific app's needs. I will be doing a more advanced app course soon though, which will have a realistic architecture.

  • @paulancajima
    @paulancajima 2 роки тому

    Thank you

  • @wavyemoji6375
    @wavyemoji6375 2 роки тому

    love you brooo

    • @wavyemoji6375
      @wavyemoji6375 2 роки тому

      lol im felt in love with coding again appreciate you man

  • @cinquain0
    @cinquain0 2 роки тому +2

    Good stuff Nick. When is push notifications coming

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому

      Haha they're coming in CloudKit section at the end of this playlist 🤓 We need a server for real push notifications, so CloudKit will be the easiest way.

  • @sondoskannous3306
    @sondoskannous3306 Рік тому

    thank you

  • @cozybazaar
    @cozybazaar 2 роки тому +1

    thank you for the amazing content Nick! I have one question: isn't [ some View ] an opaque type? so the compiler should know the concrete type at compile time (static dispatch) and switching types adds dynamism so how does the [ @ViewBuilder ] solve this problem?
    Thanks a lot 💛

  • @SE-jk2gt
    @SE-jk2gt 5 місяців тому

    Cool

  • @ModelMaster1
    @ModelMaster1 Рік тому +2

    Love your videos. So informativ! Although a couple of things do not seem to work (ViewModifier, CostumButtonStyle and most prominently the @ViewBuilder wrapper), even though I have a newer version of Xcode installed on my computer.
    When asking Chatgpt, it says, that my version of swift is too old, which would explain a lot. When checking in the build setting it says I am using swift 5 (as well as giving me the option to downgrade to 4 and 4.2).
    So my question is, is chatgpt right? And if yes, how do I fix it and why doesn’t Xcode do it automatically? Thank you for your Help.

    • @SwiftfulThinking
      @SwiftfulThinking  Рік тому +1

      These all definitely work, I use them all the time. Maybe you’re typing something wrong? The project is on my GitHub @SwiftfulThinking if u want to compare code

    • @snowy9798
      @snowy9798 Рік тому +2

      @@SwiftfulThinking Yes. I think it's some sort of setting, because to check if i was typing it wrong, I copied and pasted a view modifier code from the web and still had the same erros. Anyways, I'll figure it out later for now I am learning cloudkit. Really great video by the way. Keep up the great work! 😁

  • @jameskayten6563
    @jameskayten6563 11 місяців тому

    All these updates are worthwhile, but they're not as watchable because the navigator column is not closed and the screen space is wasted making viewing a squinting exercise.
    It's understandable, one cannot anticipate what changes made by Apple will make the older lessons a nuisance to follow, but at least make them readable. This safe area inset vid was frustrating as while in Xcode 15, much of the auto completion doesn't match up with the vid.
    I don't suppose I'll miss much in the safe area inset in any case, but the Navigation Stack lesson was difficult. And the thing is; if any file in the app collection is failing, one cannot proceed with another lesson. I've to go back and find the things that are broken before I can proceed which ofter means commenting out most of the contents unless I want to revisit the lesson. Not a complete waste of time, but still a bit of an obstacle. For instance; now that I'm moving on to the "Groups" lesson, I've to stop and find what's unhappy. I finally just deleted the last 'SafeAreasInset' file so I could get on with the program.

  • @DaikiKaneda
    @DaikiKaneda Рік тому

    you are god

  • @SwiftDeveloperWorld
    @SwiftDeveloperWorld Рік тому

    what resources do you usually study to become advance in IOS development

  • @itsAJ819
    @itsAJ819 2 роки тому

    I absolutely love your content. I enrolled in your udemy course. Would you ever consider possibly creating a slack or a discord for support? I know I could definitely use the help on one topic for sure. The Q&A from Udemy is not the greatest in regards to notifications.

    • @SwiftfulThinking
      @SwiftfulThinking  2 роки тому +1

      Thanks AJ! Yea, you're right haha. I will be starting a Discord channel next week! I'll post about it in the "Community" section of my channel once it's up.

    • @itsAJ819
      @itsAJ819 2 роки тому

      @@SwiftfulThinking absolutely amazing. I love your Udemy course. It’s helped me grasp a lot that other courses couldn’t do. Truly appreciate you my friend.

  • @AdjieSatryo
    @AdjieSatryo Рік тому

    Hi, i found that in order to create optional initialization we can use
    init(type: ViewType, @ViewBuilder content: () -> Content) {
    self.type = type
    self.content = content()
    }
    init(type: ViewType) where Content == EmptyView {
    self.type = type
    self.content = EmptyView()
    }
    Do you think its the right way? thank you

  • @mahmoudzinji5672
    @mahmoudzinji5672 Рік тому

    Can the content be nil or optional ?