How to use @State property wrapper in SwiftUI | Bootcamp #19

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

КОМЕНТАРІ • 62

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

    I can't admire your ability to explain. It is sooo clear. Thanks a lot Nick. You are the best!

  • @rippleaccount9915
    @rippleaccount9915 3 роки тому +19

    just stumbled across your channel. it really deserves more views, ive been on it for several hours. Teaching myself this stuff is difficult. Appreciate the effort and quality that goes in to these. it really helps thank you.

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

      Thanks for watching! I'm glad you feel these videos are helping :) I started the channel 2 months ago, so I'm still trying to figure it all out 😅

  • @CandiceKhannaApps
    @CandiceKhannaApps 3 роки тому +10

    FINALLY someone explains this well. Sheesh thanks 🙏🏽

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

    Great tutorials! I really don't understand how your videos don't have more views.

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

      Well thanks to you, they have more views then yesterday 😂 😁

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

    ive been using swift for about a month now and was having trouble understanding the @State property wrapper and when to use it but this video explained it perfectly! Thank you so much. Now I'm going to watch the rest of your videos :D

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

    I sure love the way you teach Nick. I've seen a lot of training videos and yours are by far the BEST! This stuff is excellent for the community! Keep up the great work!

  • @redsunset6181
    @redsunset6181 24 дні тому

    your teachings are easy to understand! Thanks

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

    Nick u are the teacher of our dreams! Thanks a lot for your work!

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

    Very clearly explained,

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

    Thank you all the time!

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

    I was the thousandth person to like this video. Thanks for the great tutorials!

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

    Hello Nick. I just want to thank you for your videos, I run into some minor hiccups here and there, but thats mostly because of XC version difference / and error on my part :D/. Thank you again and good job! :)

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

    YOU ARE THE BESYTTTTTTTTTT thank you Nick!!!!!!

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

    awesome, thank you so much!

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

    Great xplanation, thans for demoing!

  • @いろい-b2l
    @いろい-b2l 2 роки тому

    This is a very intuitive explanation. But I think one of the most confusing things about SwiftUI is why it allows people to add modifiers to Color instances, since colors are not views.

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

    In the last tutorial on buttons, you used "self.title = "button 4 ..." but here you are not using self. Looks like it isn't necessary? Curious as to when it might be necessary. Thanks!

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

    Great explains

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

    Your videos are amazing. Keep going

  • @IM-br1eb
    @IM-br1eb 3 роки тому +2

    Great teaching skills. I tried to learn SwiftUi so many times, but the quality of tutorials I watched put me off. I think I may have a chance to understand SwiftUI this time.

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

      happy to hear that! You'll pick up SwiftUI in no time 🥳

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

    Amazing bro..🤩

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

    Great series. Really enjoy it.
    With all due respect @nick: “ / “-> Slash ; and “ \ ” -> Backslash 😊

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

    Brilliant 💯

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

    Thank you!!!

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

    Great video thanks 😊 👍

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

    What is the difference between calling the variables without self. and using it? for example: backgroundColor = Color.red and self.backgroundColor = Color.red, thank you forehand

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

    clean

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

    Great content, I feel my SwiftUI skills growing, hope it gets me a job one day! Seems very all or nothing, your either really good and earn HEAPS or you are not, and can't get a job at alll ... seems like a real Ponzy scheme of an industry from the perspective of a recent uni graduate.

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

    very useful!

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

    How do you persist the color or title change for the next time you open the app. Basically I am asking is there a UserDefault alternative in SwiftUI?

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

      Yes, it’s called @AppStorage and is covered later in this playlist 🤙

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

      @@SwiftfulThinking thank you sir

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

    niceeee

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

    Good day! I have a question; can you use a @State with an enum? 😶

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

      Yes!

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

      @@SwiftfulThinking I'm gonna practice with it and see if I can figure it out. Thanks

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

      @@SwiftfulThinking Do you have a stackoverflow page?

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

    Hello Nick, how i can make my buttons have different colors, if they are all in the same Foreach (0 ..

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

      Hey Matias! I recommend watching this playlist in order and it will definitely answer this question and more 🥳

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

    in line 24, ```Text(myTitle)``` why does it not need a "/()" like in line 26

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

      myTitle is of type String. We user "\(__)" to convert a type that is not a String into a String!

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

    Great

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

    Coming from JS and C#, I don't like how you can't increment and decrement using ++ and - -

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

    Isn’t it re-rendering whole view on every click? I am in to swiftui.

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

      Yea that’s exactly how SwiftUI works. Views are Structs which are very performant

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

      @@SwiftfulThinking but if the view is fetching a lot of apis and data from server then It will be a problem. Is there anyway to re-render only the required components?

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

      @@shoprecartteam9567 This is why we use @State, the @State variable will persist through renders. Later in this series we will learn about ObservableObjects and in the next series we will use MVVM, which are both used to solve this problem!

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

      @@SwiftfulThinking is that available in your channel or you will come up with it?

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

    Thanks very much for a helpful explanation for us 🤎🤎