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

  Рет қаралды 42,156

Swiftful Thinking

Swiftful Thinking

Күн бұрын

Пікірлер: 119
@markjensen5015
@markjensen5015 2 жыл бұрын
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 KZbin. Well done!
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
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 15 күн бұрын
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 жыл бұрын
You deserve an Oscar I've been learning SwiftUI from you so far since the first step ..
@thyself125
@thyself125 3 жыл бұрын
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 😎
@pitmanra
@pitmanra 3 жыл бұрын
The init discussion at 11:00 is very helpful.
@benceylan273
@benceylan273 3 жыл бұрын
I understood init() for the first time :) Thanks mate!
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
I could not be happier to hear that! It can definitely be confusing, but doesn't have to be :)
@leyfqq
@leyfqq 2 ай бұрын
as always the best lessons on youtube ever
@yuchen3587
@yuchen3587 2 жыл бұрын
The pace is not too fast nor slow. It is just perfect.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
Haha thanks Yuchen :)
@Lvoonok
@Lvoonok 2 жыл бұрын
You are literally amazing, thank you for all your hard work and videos. I have learned more from your videos than reading documentations 🙏🙏🙏
@pablo5433
@pablo5433 3 жыл бұрын
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 :)
@ovadianyc
@ovadianyc 3 жыл бұрын
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.
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thank you!!!
@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.
@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.
@ferusinfo
@ferusinfo 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
@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.
@lifegivesuslemons421
@lifegivesuslemons421 3 ай бұрын
best course ever. you my friend are a gentleman and a scholar. I salute you.
@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.
@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.
@taosade
@taosade 2 жыл бұрын
I can't believe that's actually free! Thank you man! Your videos are BY FAR the best!
@thematturlookingfor
@thematturlookingfor Жыл бұрын
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🤘🏻
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
Haha thanks glad you’re liking them 🤙
@Dorothyinstead
@Dorothyinstead 3 жыл бұрын
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
@michelcusson2673
@michelcusson2673 2 жыл бұрын
This is the best video I've seen on youTube.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
All of KZbin? 😂
@Денис-ж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.
@muhammedturk_22
@muhammedturk_22 2 жыл бұрын
It is the best education set I have ever seen. Thank you...
@DannyBoy443
@DannyBoy443 7 ай бұрын
I really liked this video. This was a high level but understandable yet useful high level code video.
@ShowMeLova
@ShowMeLova 10 ай бұрын
I am so happy that I've found your channel. Thanks a lot Nick
@SwiftfulThinking
@SwiftfulThinking 10 ай бұрын
Glad you enjoy it!
@vedantk23
@vedantk23 5 ай бұрын
Day 2 of learning and really enjoying it. Thank you for such an amazing course.
@SwiftfulThinking
@SwiftfulThinking 5 ай бұрын
I’ll watch for your comments as you go! Good luck 🤙
@yurialenccar
@yurialenccar Жыл бұрын
Thanks for the explanation of init(). Totally helpful. You smashed it and has become easy for beginners.
@ConfidentlyRong-jo5yt
@ConfidentlyRong-jo5yt 5 ай бұрын
You're an amazing teacher! Cannot thank you enough for helping me understand init() :)
@judej5150
@judej5150 Жыл бұрын
watching your class from Korea. You're the best :) Thanks
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
Hello Korea! 🤙
@olepetersen4460
@olepetersen4460 3 жыл бұрын
Very helpful! Thanks again.
@JPkatukenda
@JPkatukenda 2 жыл бұрын
I am watching from the bottom. thank you for your effort
@dr.craigcurphey4829
@dr.craigcurphey4829 3 жыл бұрын
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 жыл бұрын
Thanks Craig! I'm just glad someone's learning something. It makes making these videos all worth it!
@ClintonSiegel
@ClintonSiegel 2 жыл бұрын
Loved this tutorial! So clear and helpful.
@biffbiffson7350
@biffbiffson7350 8 ай бұрын
Great examples eh. One always knows what's going on 🙂
@Nunny25
@Nunny25 3 жыл бұрын
Very useful, thanks
@mehekpalrecha4262
@mehekpalrecha4262 Жыл бұрын
I loved this video so much!
@mikem1451
@mikem1451 3 жыл бұрын
Awesome video!!!
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks!
@saeed_mxxx
@saeed_mxxx 8 ай бұрын
thank you for sharing you knowledge 😘
@aniltodakar6449
@aniltodakar6449 9 ай бұрын
Thanks for this video.
@최인선-u1l
@최인선-u1l 2 жыл бұрын
THANK YOU SO MUCH NICK❤‍🔥❤‍🔥
@maheshkumarmudigonda6213
@maheshkumarmudigonda6213 Жыл бұрын
Just Wow, Big Love you Bro ❣
@andresraigoza2082
@andresraigoza2082 3 жыл бұрын
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.
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks for letting me know 😅
@Dragonboh1
@Dragonboh1 Жыл бұрын
keep doing what you doing
@UareAcreep
@UareAcreep 3 жыл бұрын
Great video! Thanks
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Glad you liked it! Thanks for watching David.
@andrewmack4830
@andrewmack4830 2 жыл бұрын
great video. Thank you
@bbulliard
@bbulliard 3 жыл бұрын
Wonderful video
@최승기-g8f
@최승기-g8f 3 жыл бұрын
Thank you!!!
@valerieokelly6224
@valerieokelly6224 2 жыл бұрын
Super clear 👍😎
@ProgramJerol
@ProgramJerol 8 ай бұрын
cornerRadius will be deprecated, instead we will be possibly using clipShape rectangle
@andrejkling3886
@andrejkling3886 3 жыл бұрын
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...
@knowledgeispower4953
@knowledgeispower4953 10 ай бұрын
good bro..😊
@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.
@SeniaSer
@SeniaSer Жыл бұрын
Hello thank you for lessons but i have some error (missing arguments for parameters 'backgroundColor', 'count', 'title' in call)
@vortex5896
@vortex5896 3 жыл бұрын
good video
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thanks Vortex!
@YaroslavSherstyuk
@YaroslavSherstyuk 3 жыл бұрын
Thank you for the video
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
Thank you Ярослав!
@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 Жыл бұрын
Why does it also require me to have an input parameter in the @main WindowGroup file and yours doesn't?
@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 6 ай бұрын
Missing argument for parameter backgrouncColor in call.
@Аселичка
@Аселичка 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?
@aslanmmmdli1476
@aslanmmmdli1476 2 жыл бұрын
the same here. did u solve it?
@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.
@heismyke
@heismyke 5 ай бұрын
Return from initializer without initializing all stored properties i got this error
@GabeColors
@GabeColors 3 жыл бұрын
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!
@m__link6499
@m__link6499 3 жыл бұрын
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!!!
@user-goldeneunga
@user-goldeneunga Жыл бұрын
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 Жыл бұрын
@@user-goldeneunga Hello from across the world 👍
@belveloper
@belveloper 10 ай бұрын
Self is the same as this in other languages Like dart java ...
@pitmanra
@pitmanra 3 жыл бұрын
At 8:05, that's a backslash, not a forward slash. ; )
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
lol oops -__-
@m__link6499
@m__link6499 3 жыл бұрын
6’57 : why it doesn’t work for me when I fill the previews ?
@SwiftfulThinking
@SwiftfulThinking 3 жыл бұрын
What error message are you getting?
@Денис-ж3ф5р
@Денис-ж3ф5р 3 жыл бұрын
It's not that hard if you know Swift language and switched from C#.
@gucp
@gucp Жыл бұрын
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 Жыл бұрын
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
@Jeff-zc6rr
@Jeff-zc6rr 6 ай бұрын
does this not work in 2024?
@ubu-ibme
@ubu-ibme 9 ай бұрын
\ = backslash I only bring it up cuz I was listening and typing and following along and I typed it wrong lol
@SwiftfulThinking
@SwiftfulThinking 9 ай бұрын
💔😅
@SwiftfulThinking
@SwiftfulThinking 9 ай бұрын
I’m learning too 😂
@ubu-ibme
@ubu-ibme 9 ай бұрын
@@SwiftfulThinking hahaha! Stay reachable 😂
@dugrut1325
@dugrut1325 2 жыл бұрын
these two things I avoid: I guess it's time to learn...
@АлександрТопал-щ2м
@АлександрТопал-щ2м 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
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
The source code is on my GitHub @SwiftfulThinking
@АлександрТопал-щ2м
@АлександрТопал-щ2м 2 жыл бұрын
@@SwiftfulThinking you're the best, thanks
@mkdevz3092
@mkdevz3092 2 жыл бұрын
Thank you! Clear and to the point 🫡
@magedmohmed4403
@magedmohmed4403 2 жыл бұрын
Thanks Again , you are very helpful for us 🤎🤎
@simonwachtler2835
@simonwachtler2835 3 жыл бұрын
Great Video! Thanks
@theflutterguy6301
@theflutterguy6301 6 ай бұрын
good video
How to use ForEach loops in SwiftUI | Bootcamp #14
13:30
Swiftful Thinking
Рет қаралды 40 М.
LazyVGrid, LazyHGrid, and GridItems in SwiftUI | Bootcamp #16
22:16
Swiftful Thinking
Рет қаралды 47 М.
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33
А я думаю что за звук такой знакомый? 😂😂😂
00:15
Денис Кукояка
Рет қаралды 4,3 МЛН
Players push long pins through a cardboard box attempting to pop the balloon!
00:31
This Game Is Wild...
00:19
MrBeast
Рет қаралды 174 МЛН
How to use @ObservableObject and @StateObject in SwiftUI | Bootcamp #50
35:12
How to use NavigationStack in SwiftUI | Bootcamp #62
23:59
Swiftful Thinking
Рет қаралды 37 М.
SwiftUI Card View - Group Box & Customizations
10:21
Sean Allen
Рет қаралды 17 М.
How to use and ignore the Safe Area in SwiftUI | Bootcamp #17
17:24
Swiftful Thinking
Рет қаралды 29 М.
Introduction to enums in Swift
15:22
Stewart Lynch
Рет қаралды 5 М.
How to use @EnvironmentObject in SwiftUI | Bootcamp #51
26:48
Swiftful Thinking
Рет қаралды 39 М.
VStack, HStack, and ZStack in SwiftUI | Bootcamp #10
21:37
Swiftful Thinking
Рет қаралды 43 М.
Understanding Swift Initializers
25:39
Stewart Lynch
Рет қаралды 6 М.
How to use NavigationView and NavigationLink in SwiftUI | Bootcamp #30
16:46
Noodles Eating Challenge, So Magical! So Much Fun#Funnyfamily #Partygames #Funny
00:33