How to use inits and enums in SwiftUI | Bootcamp #13

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

КОМЕНТАРІ • 119

  • @markjensen5015
    @markjensen5015 2 роки тому +74

    I've looked at 3 books, and two paid courses, and Apple's own SwiftUI tutorial, and this is the best approach by FAR! Also, way better than anything I've seen on UA-cam. Well done!

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

      Thanks Mark 😁 let me know if you have questions!

    • @zerezc
      @zerezc 5 місяців тому

      same here, finally got out of tutorial hell with his explanations

  • @rishabhbhatia1847
    @rishabhbhatia1847 8 днів тому +1

    Brilliant! I was doing "Hacking with swift UI" by Paul Huson before this but your explanations are way better and intuitive. Plus, you cover everything around the feature your are explaining with such ease and clarity.

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

    You deserve an Oscar I've been learning SwiftUI from you so far since the first step ..

  • @benceylan273
    @benceylan273 3 роки тому +12

    I understood init() for the first time :)
    Thanks mate!

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

      I could not be happier to hear that! It can definitely be confusing, but doesn't have to be :)

  • @pitmanra
    @pitmanra 3 роки тому +8

    The init discussion at 11:00 is very helpful.

  • @thyself125
    @thyself125 3 роки тому +9

    Holy shit dude! You are changing lives. You are demystifying this like crazy. I didn’t even know you could that in SwiftUI. I learned about swift basics but didn’t know the SwiftUI and swift structures were that same in the sense that they can have initializers. Gears are turning in my brain. Thank you!!!!! I can’t thank you enough.

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

      Hahaha if you thought this one was crazy just wait 😎

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

    The pace is not too fast nor slow. It is just perfect.

  • @leyfqq
    @leyfqq 2 місяці тому +1

    as always the best lessons on youtube ever

  • @pablo5433
    @pablo5433 3 роки тому +4

    My friend, I was about to give up SwiftUI and start studying Flutter😅, but thanks to your videos I have learned in a few days what I could not internalize in months. Thanks!!

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

      Hey Pablo! I'm glad you stayed with SwiftUI! I think it's a much smarter path to go down :)

  • @Lvoonok
    @Lvoonok 2 роки тому +6

    You are literally amazing, thank you for all your hard work and videos. I have learned more from your videos than reading documentations 🙏🙏🙏

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

    The ios courses I take on other places, nothing is as clear as your explanations. This is by far the best. Thank you for your effort.

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

    Dude this series is amazing. Im gunna make sure and give you a shout on some socials, these tutorials are just so ridiculously well done and should be top of the heap for people learning.
    Thanks for making them🤘🏻

  • @lifegivesuslemons421
    @lifegivesuslemons421 3 місяці тому

    best course ever. you my friend are a gentleman and a scholar. I salute you.

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

    This is the best video I've seen on youTube.

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

    Just a stupid comment for precision's sake. The forward slash is this /, and the backslash is this \. Thank you for your excellent course.

  • @ThiagoMenezes-l4m
    @ThiagoMenezes-l4m Рік тому

    Eu sou br e acho q ngm vai ler isso, mas namoral que série perfeita, finalmente entendi para oque serve enums, nunca soube para o que era, valeu cara, tu tá me salvando muito.

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

    It is the best education set I have ever seen. Thank you...

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

    I can't believe that's actually free! Thank you man! Your videos are BY FAR the best!

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

    This video caused some light bulbs 💡 to go on in my head , as simple as it was but it really helped me to connect some dots. thank you so much for the quality content.

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

    As per discussion in 11:26, SwiftUI is not just "smart" - it works across Swift as a language: "Swift provides a default initializer for any structure or class that provides default values for all of its properties and doesn’t provide at least one initializer itself."
    This bootcamp is the greatest thing that exists for iOS developers - not only juniors, but seniors like me as well.

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

      Yep, correct and also I believe since all views in SwiftUI are struct, and in Swift struct created automated designated initializers, that's why no need to write the init implementation so far

  • @DannyBoy443
    @DannyBoy443 7 місяців тому

    I really liked this video. This was a high level but understandable yet useful high level code video.

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

    watching your class from Korea. You're the best :) Thanks

  • @vedantk23
    @vedantk23 5 місяців тому

    Day 2 of learning and really enjoying it. Thank you for such an amazing course.

    • @SwiftfulThinking
      @SwiftfulThinking  5 місяців тому +1

      I’ll watch for your comments as you go! Good luck 🤙

  • @comics-on
    @comics-on 2 роки тому

    Man, everything about this course is super helpful. However I'm glad to did a Swift programming course before this. I believe learning and mastering SwiftUI is already a daunting task without having to learn the language simultaneously.

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

    I am so happy that I've found your channel. Thanks a lot Nick

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

    Thanks for the explanation of init(). Totally helpful. You smashed it and has become easy for beginners.

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

    You know the funny part, this wouldn’t been a lot harder video, if I wasn’t already a UIKit developer who just came here to learn SwiftUI specifics in depth, so far the course is extremely well organised, especially for me because I like to do it slow but in depth.

  • @Dorothyinstead
    @Dorothyinstead 3 роки тому +1

    To a lay person this subject appears quite daunting. However, as with all your previous videos Nick, your teaching style makes it much less overwhelming.

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

      I really appreciate these comments. Thanks for watching Rob! This is probably the hardest video in the series so far haha

  • @ConfidentlyRong-jo5yt
    @ConfidentlyRong-jo5yt 5 місяців тому

    You're an amazing teacher! Cannot thank you enough for helping me understand init() :)

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

    Very helpful! Thanks again.

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 роки тому

    It is all related to Swift on to SwiftUI. Very basic level. Unluckily, I'd already known this stuff before watching, unluckily because the explanation is flawless even in X2.

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

    I am watching from the bottom. thank you for your effort

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

    Loved this tutorial! So clear and helpful.

  • @saeed_mxxx
    @saeed_mxxx 8 місяців тому

    thank you for sharing you knowledge 😘

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

    Just Wow, Big Love you Bro

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

    I loved this video so much!

  • @dr.craigcurphey4829
    @dr.craigcurphey4829 3 роки тому +5

    Once again I haft commend you on your approach. If you ever start some sort of support or consulting offer I would be very interested. Plus I believe by the end of this course I will be able to do my very unique app for which there is nothing else out there. Many thanks!

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

      Thanks Craig! I'm just glad someone's learning something. It makes making these videos all worth it!

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

    Awesome video!!!

  • @Nunny25
    @Nunny25 3 роки тому +1

    Very useful, thanks

  • @최인선-u1l
    @최인선-u1l 2 роки тому

    THANK YOU SO MUCH NICK❤‍🔥❤‍🔥

  • @biffbiffson7350
    @biffbiffson7350 8 місяців тому

    Great examples eh. One always knows what's going on 🙂

  • @aniltodakar6449
    @aniltodakar6449 9 місяців тому

    Thanks for this video.

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

    Wonderful video

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

    great video. Thank you

  • @UareAcreep
    @UareAcreep 3 роки тому +1

    Great video! Thanks

  • @andresraigoza2082
    @andresraigoza2082 3 роки тому +1

    Great content! Thanks. And maybe you would want to change the link of the next video, when I hit on that link, it takes me to this very same video.

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

    keep doing what you doing

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

    Super clear 👍😎

  • @andrejkling3886
    @andrejkling3886 3 роки тому +1

    Thank you good tutorial...

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

      Haha thanks Andrej! You don't watch them in order do you 🧐 haha

    • @andrejkling3886
      @andrejkling3886 3 роки тому

      @@SwiftfulThinking Yes, I´ll start watching intermediate level, this level I just repeat again by jumping...-:)) but some point very useful and new for me... I like how you can observe from different corners... keep going Nick, I told you -
      you are smart...

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

    Hi there, thanks very much for these very helpful videos. I completely followed along the whole way through. I was just surprised we could change the view through the PreviewProvider (struct InitializerBootcamp_Previews) as opposed to only struct InitializerBootcamp: View. Is this a common practice or is it unlikely we would need to change the views in the PreviewProvider? I just imagine it getting complicated if the UI was complex and had a lot of components.

  • @knowledgeispower4953
    @knowledgeispower4953 9 місяців тому

    good bro..😊

  • @최승기-g8f
    @최승기-g8f 3 роки тому +1

    Thank you!!!

  • @vortex5896
    @vortex5896 3 роки тому +1

    good video

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

    Hello thank you for lessons but i have some error (missing arguments for parameters 'backgroundColor', 'count', 'title' in call)

  • @YaroslavSherstyuk
    @YaroslavSherstyuk 3 роки тому

    Thank you for the video

  • @jcclcreations7909
    @jcclcreations7909 9 місяців тому

    Was a Switch statement not used because this is a beginner course or is there another reason for it?

  • @Jeff-zc6rr
    @Jeff-zc6rr Рік тому

    Why does it also require me to have an input parameter in the @main WindowGroup file and yours doesn't?

  • @rasheed1andrew
    @rasheed1andrew 3 роки тому

    I created an initializer that creates a row for a list. I created this same row before without the initializer but I think the code looks neat when its created as an initializer. this is where I find a problem,. on the last row I created, I was able to create an image that has an on tap gesture which updates the ui for the row. pretty much a subscription icon that changes color depending on what state the subscription is in. the function to update this ui is from a view model. do I add this function in the view where the instance was created and how? or do I add this function when I call the initializer in a different view within a list?

  • @Jeff-zc6rr
    @Jeff-zc6rr 6 місяців тому

    How do you make two frames show by putting it twice in the PreviewProvider? I have to put them in the original @main file twice.

    • @Jeff-zc6rr
      @Jeff-zc6rr 6 місяців тому

      Holy jesus.. there are two preview screens .. One for the App and one for the current window.

  • @Аселичка
    @Аселичка 2 роки тому

    Hi! Thanks for the video. Did everything as you said till 7:04, but after resume the system says: missing argument for parameter ‘backgroundColor’ in a call… what that might mean?

  • @GabeColors
    @GabeColors 3 роки тому +1

    At 17:30 you say “when we type a period” how would I know that?

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

      Haha that's how enums work! We create an enum with a bunch of different options and then when we go to add one, Xcode automatically gives us the autocomplete with all of the options. I highly recommend using enums as much as possible!

  • @ProgramJerol
    @ProgramJerol 8 місяців тому

    cornerRadius will be deprecated, instead we will be possibly using clipShape rectangle

  • @user-goldeneunga
    @user-goldeneunga Рік тому +1

    Can you please teach me what self. means?? I'm really confusing..

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

      self refers to the object that you’re in. So if your within a class and you call self, you’re referring to the parent class. I’ll try to do a video on this soon!

    • @user-goldeneunga
      @user-goldeneunga Рік тому

      @@SwiftfulThinking Thank you so much!! I'm learning swiftUI so well thanks to you!! You have so good pronuciation that me, Korea student can easily understand the video Thanks!

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

      @@user-goldeneunga Hello from across the world 👍

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

      Self is the same as this in other languages
      Like dart java ...

  • @heismyke
    @heismyke 5 місяців тому

    Return from initializer without initializing all stored properties i got this error

  • @Jeff-zc6rr
    @Jeff-zc6rr 6 місяців тому

    Missing argument for parameter backgrouncColor in call.

  • @m__link6499
    @m__link6499 3 роки тому

    6’57 : why it doesn’t work for me when I fill the previews ?

  • @pitmanra
    @pitmanra 3 роки тому

    At 8:05, that's a backslash, not a forward slash. ; )

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

    What's wrong with this code please ? 🤔
    struct ContentView: View {
    let name: String
    var body: some View {
    Text(name)
    .padding()
    }
    }
    struct ContentView_Previews: PreviewProvider {
    static var previews: some View {
    ContentView(name: "john")
    }
    }

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

      Hello! I copied and pasted the code and it works fine. I don't see any issue. Are you getting an error message?

    • @m__link6499
      @m__link6499 3 роки тому

      @@SwiftfulThinking Now suddenly I works...Very weird 🤔...thank you and keep going...Your videos are powerfull!!!

  • @Jeff-zc6rr
    @Jeff-zc6rr 6 місяців тому

    does this not work in 2024?

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

    Do I always have to use self.something when the conditional is within an innit? Is there another video explaining the use of self.?

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

      No you don’t need to use self. I was doing that to be clear in the tutorial that self. refers to the variable in the struct and not the variable passed into the struct (since they have the same name)

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

      @@SwiftfulThinking thanks! It makes sense now

  • @Денис-ж3ф5р
    @Денис-ж3ф5р 3 роки тому +1

    It's not that hard if you know Swift language and switched from C#.

  • @ubu-ibme
    @ubu-ibme 8 місяців тому

    \ = backslash
    I only bring it up cuz I was listening and typing and following along and I typed it wrong lol

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

    these two things I avoid: I guess it's time to learn...

  • @АлександрТопал-щ2м

    Wrote exactly the same code as in the video, but an error occurs "missing arguments for parameters "backGroundColor", "count" , "title" in call. Help pls

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

    Thank you!
    Clear and to the point 🫡

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

    Thanks Again , you are very helpful for us 🤎🤎

  • @simonwachtler2835
    @simonwachtler2835 3 роки тому +3

    Great Video! Thanks

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

    good video