thank you for this series...it's like helping me read Swift's syntax and grammar and functionality. Which helps me understand how UIs and the tutorials work from the written aspect! Thank you so much!
This video looks like getter and setter for encapsulation in struct. I ever learned getter and setter in c++ . Actually same but method how to make is different. Thankyou nick
@@SwiftfulThinking I really started my first coding from you. I understood the whole base level just because of your wonderful skills and explaining. Keep it up🤝
Hi! Thank you for these handy videos. In this one, I don't understand why you mentioned in previous videos using structs as preferable, but inside the struct, you use funcs that are risky for threading...
@@fran8a You're partly right: mutable shared instances of structs can still be accessed or modified by multiple threads, leading to race conditions. This means you can't always guarantee you're reading the latest value. However, since structs are value types and are copied when passed around, changes to a copy won't affect the original, making them effectively thread-safe in those cases due to no shared resources.
This one is a hard one. I completely lost the path from the previous videos. Even the one before this you mentioned was very “hard” it was very easy to me I got it completely. But this one right here… lost
Hey Nick!👋Thanks for the video! Question: If someone ever worked with Figma components, can we say that this analogy is true: Struct is a main component with parameters we defined. Mutating a struct is like creating an instance of that component + changing values of parameters we defined?
You can google it, there are a few StackOverflow posts about it. The differences are so minimal that it doesn’t make a material difference. It’s just how the change is technically handled in memory. If you’re just learning Swift, I wouldn’t worry about it.
13:05 the sign of a good teaching
thank you for this series...it's like helping me read Swift's syntax and grammar and functionality. Which helps me understand how UIs and the tutorials work from the written aspect! Thank you so much!
I appreciate you explicitly making a video on the basics of structs, Nick. They're truly gems!
Спасибо, Ник!!! Как всегда, на высоте!
This video looks like getter and setter for encapsulation in struct. I ever learned getter and setter in c++ . Actually same but method how to make is different. Thankyou nick
Thank you very much buddy! You are goated. Really appreciate you))
Glad I could help
@@SwiftfulThinking I really started my first coding from you. I understood the whole base level just because of your wonderful skills and explaining. Keep it up🤝
Hi!
Thank you for these handy videos.
In this one, I don't understand why you mentioned in previous videos using structs as preferable, but inside the struct, you use funcs that are risky for threading...
There are no threading issues with structs because they are handled differently in memory. Structs are passed by value and not reference
@@SwiftfulThinking even if you use a func inside a struct? this drives me crazy :S
@@fran8a You're partly right: mutable shared instances of structs can still be accessed or modified by multiple threads, leading to race conditions. This means you can't always guarantee you're reading the latest value. However, since structs are value types and are copied when passed around, changes to a copy won't affect the original, making them effectively thread-safe in those cases due to no shared resources.
Love these videos. Say you have 100 variables in your struct. How would you go about updating them individually?
This one is a hard one. I completely lost the path from the previous videos. Even the one before this you mentioned was very “hard” it was very easy to me I got it completely. But this one right here… lost
lol, Me too, I'm soooooo lost
It is harder! I'll have to rewatch a few more times. Hopefully it will click
Hiiiii men thank you for helping me so much in my career as iOS dev
Well Done Nick!I like a lot how you comment out what u are doing and i wonder if u do it the same way when you write apps for yourself ?
Hey Nick!👋Thanks for the video!
Question:
If someone ever worked with Figma components, can we say that this analogy is true:
Struct is a main component with parameters we defined.
Mutating a struct is like creating an instance of that component + changing values of parameters we defined?
how can we get access to this project file for learning purposes
hello ,can t find the source code on the website
when will you provide us reason why there is benefit of using mutating function instead of creating new struct itself?
You can google it, there are a few StackOverflow posts about it. The differences are so minimal that it doesn’t make a material difference. It’s just how the change is technically handled in memory. If you’re just learning Swift, I wouldn’t worry about it.
Thank you so much..! may God always bestow good fortune on you and your family and always be under God's protection. Amminn
Be careful passing mutating func around when you start using concurrency. Value types aren’t as safe as you might think
Thank you, Nick 🫶