Thanks a lot for your video. Perhaps the best I've seen on this topic. Watching your videos from Russia, Moscow.
@benyaminabediyan54514 ай бұрын
Usually I don't write any comments but thank you Stewart; you helped me understand this damn concept. Really appreciate your work. hope you would start making a full fledged course on Swift and SwiftUI.
@root_pegasus6 ай бұрын
I've paid for the "best" content in Udemy and nobody explains like you It's amazing that content like this is free
@StewartLynch6 ай бұрын
I am glad you are finding it useful
@pifeeder90273 жыл бұрын
Best explanation on closures I have ever seen
@christophgeisel9708 Жыл бұрын
I have been struggling to understand Closures and tried all kinds of reading materials and tutorials to no avail. This tutorial was simply amazing and if it’s any further indication of the teaching style, why did I not find you sooner 😆
@StewartLynch Жыл бұрын
I guess I have to improve my advertising :).
@spacemeter30013 жыл бұрын
This video is worth GOLD. Struggled to understand the syntax of closures and how they're used but now I understand it thanks to your examples!
@StewartLynch3 жыл бұрын
Thanks. That is what I set out to do. Appreciate the feedback.
@sawjaixx7113 жыл бұрын
THANK YOU!!! Your detail explanation helped solve my confusion.
@StewartLynch3 жыл бұрын
Great. Glad it could clarify for you.
@Landon_Hughes3 жыл бұрын
Closures are definitely one of the more confusing topics in Swift; this video explains them perfectly!
@absar66 Жыл бұрын
This is called quality tutorial with calm instructions...many thanks 👍
@eyupmert733810 ай бұрын
Amazing. I really can't say anything else. I was struggling with closures, it's hard to understand because it's hard to explain I guess 😅 But you found a great way to explain the topic. Incrementing the level of knowledge slowly with different examples. And showing behind the scenes slowly. That's it! 👏
@StewartLynch10 ай бұрын
Glad it helped!
@mhfs613 жыл бұрын
As always, very educational Stewart. No voodoo, just calm and clear explanation. 👍🏼👍🏼👍🏼
@FRkiddo Жыл бұрын
this is great, your style of explaining is really good
@kal5211 Жыл бұрын
Excellent. Thank you.
@abhiireddy63 жыл бұрын
one of the bestest lectures i have ever listened.. thank you very much
@toluojo61413 жыл бұрын
You are the best. Can't believe how much I've learned so far from you. Thanks a million
@StewartLynch3 жыл бұрын
Happy to hear that!
@samuelpatrickhenness3 жыл бұрын
Thanks Stewart, another really useful video. its great to finally understand how things I've been doing for a while actually work!
@StewartLynch3 жыл бұрын
Glad it helped! That is exactly what I am trying to achieve with my videos. My rule now is to not use anything that I do not understand myself.
@joshuashires3 жыл бұрын
Epic once again Stewart. I have read the documentation over and over about closures and struggled to grasp the “Why” but comparing them to how we would usually write functions really really helped. A great follow on to this video would be expanding on the “Why?”. Your explanation using the VStack example was a big “Ohhhh i get it” moment but it would be good to see more examples of why should we use closures with real world examples. The thing I find hard is looking at a problem and implementing closures because doing it with functions in the traditional way just makes more sense and I cant see the advantage to using closures. However your completion handlers video might help with implementation of closures. Keep up the good work! Thank you for your contribution.
@davidspicer80533 жыл бұрын
Certainly the absolute best video on closures i've ever seen!
@StewartLynch3 жыл бұрын
Thanks for that David. Glad you liked it.
@cristhianleon22283 жыл бұрын
What a clear and detailed explanation, especially with the capturing values. Thanks!
@baylorjaxton51993 жыл бұрын
sorry to be offtopic but does any of you know a tool to log back into an instagram account? I was stupid forgot my password. I would appreciate any help you can offer me!
@judsonbrendan6573 жыл бұрын
@Baylor Jaxton instablaster =)
@baylorjaxton51993 жыл бұрын
@Judson Brendan Thanks so much for your reply. I found the site thru google and Im trying it out atm. I see it takes quite some time so I will get back to you later when my account password hopefully is recovered.
@baylorjaxton51993 жыл бұрын
@Judson Brendan it did the trick and I finally got access to my account again. Im so happy:D Thanks so much, you really help me out :D
@judsonbrendan6573 жыл бұрын
@Baylor Jaxton no problem xD
@semilife3 жыл бұрын
Thanks Stewart un-voodooing the Voodoo. Clear simple, concise.
@StewartLynch3 жыл бұрын
Glad you found it helpful
@headach09 Жыл бұрын
Lots of cases comparing !! Much thanks :)
@jasurrajabov3 жыл бұрын
Tutorials are one of the best, with both high-quality video edit and the content itself very informative. Also love to see tutorials using closures with using weak, unowned. Thank you very much.
@AchrafTrabelsiMobileDeveloper2 жыл бұрын
Thank your for this amazing video about closure, very helpful !
@edwarmartinez2282 жыл бұрын
Thank you Stewart, you are Really a teacher
@jaaviondavis97903 жыл бұрын
Thank you so much! I was struggling to figure out the meaning, the syntax, the use cases of closures in swift. After watching the video I'm able to logically think it out as a code and not stray away from the context. Please upload more videos because the way you explain concepts and your thought process is impeccable. I will definitely subscribe.
@StewartLynch3 жыл бұрын
I am approaching 150 videos now so I will continue. Enjoy.
@jaaviondavis97903 жыл бұрын
@@StewartLynch Do you have any videos explaining protocols and delegates?
@StewartLynch3 жыл бұрын
I don’t think so. I seldom use them now with SwiftUI as there are alternate ways. I prefer to pass closures.
@marcaupont91453 жыл бұрын
Great job Stewart! Very thorough explanations!
@StewartLynch3 жыл бұрын
Thanks Marc. This means a great deal coming from you,.
@ribosome80852 жыл бұрын
Steward is awesome 👏 thank you so much!
@shadieossei43363 жыл бұрын
Great job explaining! I'm beginning to understand closures a little bit.
@3luizcunha3 жыл бұрын
Always incredible videos, thank you very much Stewart
@StewartLynch3 жыл бұрын
Thanks
@rolandolahmusic3 жыл бұрын
Fantastic explanation!
@leneil46 Жыл бұрын
Wow this video helped me out so much! Thank you.
@daniel_munoz_r3 жыл бұрын
Thank you very much for this video.
@Simon-ro8nh3 жыл бұрын
What a great video! This is super helpful! Thank you Stewart!
@DavidKoontz2 жыл бұрын
Thanks that was a great explanation.
@abdulbasir87403 жыл бұрын
Such an amazing tutorial, Thanks a Billion.
@StewartLynch3 жыл бұрын
You're very welcome!
@Александра-ш8ж1б3 жыл бұрын
I admire you! Thank you for such a detailed and simple explanation.
@KimbrellBrad3 жыл бұрын
That @escaping example really made me understand what is happening in these cases! Never really go it until now. Thanks Stewart! Oh, I have to ask...who does your cover art for these videos? They are really entertaining and have a lot of thought behind them! Bravo! BTW, I think it is you, your significant other, or a good friend. This much detail would likely be expensive!)
@StewartLynch3 жыл бұрын
I use a free app called Bitmoji Brad. Available on the App Store. You design your own avatar and then it provides you with hundreds of scenes that you can pick from. Anyone can do it. Other KZbin content providers use it as well.
@shreesharao83083 жыл бұрын
Best Explanation..It was helpful... Keep it up :)
@kasunjayasekara30523 жыл бұрын
Thank you very much finally I understand it correctly :)
@StewartLynch3 жыл бұрын
Glad I could help
@ravisaini80343 жыл бұрын
Thank you so much sir.
@lautarob11 ай бұрын
Hello, enlighten videos! Thanks subscribed!!
@ScottGrunwald3 жыл бұрын
Thanks for the great video
@oneCrispy Жыл бұрын
thank you.
@drmucahiderdogan3 жыл бұрын
Great video.
@Aightbruh023 жыл бұрын
Please do a similar video about memory management and retain cycle
@vamsi38773 жыл бұрын
Wow superb 👏
@doesntmatter68273 жыл бұрын
Amazing!
@1sudrap3 жыл бұрын
Very nice and comprehensible video which really helped me to get a good grasp of this topic, but just a small remark: Why do you say "Declare variable" and actually declare a constant. You did it at least twice in this video. But anyway great job.
@StewartLynch3 жыл бұрын
Yah, I make that mistake all the time and interchange variable and constant. I try to catch and correct those things, but as you can see, I am not always successful. I have a tendency like many others to use variables when constants will do just fine. I script my videos before I record the video and then add the audio later after recording. As I am building the video, I realize that a constant will be just fine and then forget to edit my script when I am recording the audio. I will try harder next time to catch these things.
@brandonwinston3 жыл бұрын
How does it work that your “PublicFunctions” function takes a ()->Void but then we toss a bunch of different types of closures at it that are not ()->Void?
@StewartLynch3 жыл бұрын
Perhaps this will clear it up. We can create a function that itself contains whatever code we want, including other functions. func example1() { func sayHello() { print("Hello") } sayHello() } Notice that example1() has no parameters and returns nothing so it is of type () -> Void We can then use that public "code" function to pass in example1 as our sampleCode because it meets the requirement for our closure. code(for: "Another Example", sampleCode: example1) Now, because sampeCode is a trailing closure, it could be written like this: code(for: "Another Example" { example1() } So instead of defining example1 as a function, we can simply pass in the body like this. code(for: "Another Example") { func sayHello() { print("Hello") } sayHello() } Does that help?
@brandonwinston3 жыл бұрын
@@StewartLynch yes thank you very much!
@kenturnbull96793 жыл бұрын
This one??? I see Completion handlers as well. KT
@itchyminge Жыл бұрын
Why do you call finallySayIt within the function, and then pass in a different function (closure) called reallySayIt? Could you not call finallySayIt within the sayHello function?
@StewartLynch Жыл бұрын
I am not sure I understand your question. Feel free to email me if you want to explore this further.
@Sokrates83 жыл бұрын
Strangely I can't download the Starter Files with the Chrome Browser; always have to switch to safari.
@StewartLynch3 жыл бұрын
Sounds like a security issue. It is a Zip file so that could be your issue.
@kenturnbull96793 жыл бұрын
@@StewartLynch I regularly use Chrome, Canary, and Firefox Dev. I can download the starter files in ALL of them as well as unzipping them. In fact, I just checked all of them before I commented. In addition to the Closure info, I really enjoyed seeing what things can be done with Playground... but my spelling is starting to suffer :-)
@nickapeed Жыл бұрын
Great video here and your other work! I'm a new subscriber, thanks!! Question for anyone that can help me at 10:08 func sayHello(to name: String, finallySayIt: (String) -> ()) { what is the purpose of the "to" here?
@StewartLynch Жыл бұрын
It is simply there to make the function more readable at the call site. sayHello to “xxxxxx” instead of sayHello “xxxxxx”
@mcquinmadtha Жыл бұрын
"to" is the external parameter name, whereas "name" is the internal parameter name. So when passing a parameter, instead of saying sayHello name: "Sam", it would look like sayHello to "Sam", much more readable
@mx.stoneheart3 жыл бұрын
@14:00 calling me TF out
@StewartLynch3 жыл бұрын
I think we have all been there.
@richoffks3 жыл бұрын
bruh, I wasted two hours finding out this code doesnt even work smh
@StewartLynch3 жыл бұрын
Pardon me? What are you referring to? It would help if you could be more specific, because the code does indeed work in this video.
@richoffks3 жыл бұрын
@@StewartLynch when I create the exact same functions as the one in the video, an error pops up because of the incorrect parameter name
@StewartLynch3 жыл бұрын
DM me on Twitter @StewartLynch and share your code with me so I can see what you are doing wrong.
@StewartLynch3 жыл бұрын
I also just downloaded the completed playground from the link provided and all of the code works fine, even in Xcode 13 beta so you must be doing something wrong in your implementation. I am more than happy to check your code.