I really felt like I got a handle on escaping for the first time, thanks very much for the clear explanation! Briefly included in here was an example of your approach to closures. I think I have a mental block for closures, as I've reviewed them dozens of times and momentarily felt like I almost understood them, only to have the understanding slip away again. I guess what I'm wondering is whether there is a way to know, in this video for example before you introduce the asynchronous task in downloadData3, how to decide upon when and how to use closures and completion handlers. In any case, keep up the great work, I really appreciate your effort and attention to detail!
Thanks Pitmanra. Don't stress about this one too much, we're going to be using Combine most of the time anyway! You'll grasp this pretty easily when we start using it in apps :)
Thanks Nick! this tutorial really do helped me! By the way, I come to curious about a completion handler. As soon as completion handler is called, I understood that the bracket in the upper? function(like getDat function in the video) is called. Than, can I do something AFTER the completion function is completed? Like, writing more code after completionHandler("new data!") block in func downloadData2 Anyway, really easy and good tutorial!
Hey Nick. I noticed something that's been reoccurring in a few of your videos and I'm guessing it's just an xcode update, but at 9:41 when you hit enter on the completions, xcode seems to add in parenthesis, whereas in mine, it does not. It doesn't seem to make a difference but still... Are the parenthesis unnecessary?
Yes, there are 3 main ways actually. Using @escaping closures was the first evolution of Swift, then came Combine, and the newest is async/await. It’s important for iOS devs to know them all. Comparison here: ruclips.net/video/9fXI6o39jLQ/видео.htmlsi=34gCTbav25aw9gJC
This is a good question! Learning Swift with knowledge of Dart, I am not liking this syntax at all in terms of readability. As Nick is saying here, I understand that devs need to be able to read "old" code when working in teams, but as a solo dev, I definitely prefer to use async/await (just like Dart). So much cleaner, and so much more readable. Thanks for the explanation Nick! 👍
I’m not sure how many times I watched this video but I think finally I got it. Well I’ll let you know once I start typing code. What I want to do is start a function but as the function is running send out a status @State value to the view in real time. I’m hoping this method of escaping will do that? What do you think?
Well my plan did not work. The code worked in that there were no errors but the @StateObject value would not display in the view in real time. I’m at a lost!
I've enjoyed your other videos but found this a bit lacking in depth. If the compiler can already tell you need @escaping through the error message why do you need to explicitly state it. Are there cases when you don't need to state it? What is @escaping actually doing?
@escaping is telling the compiler that this function we are passing it is going to “escape” the function it’s being called from. In other words, the function passed in can outlive the function it’s called within
Your tutorials are very practical compared to others, specially for people coming from other programming languages
I’ve seen like 5 videos about escaping but this one sank in easily 👍 thanks
Happy to hear that Essa! Thanks for watching.
Same journey for me. Thanks Nick!
Best explanation about escaping 🤩👏
i love you man you make the swiftUI so easy
Haha Thanks Muhammad.. but it's not me. It's Apple that made SwiftUI so easy 😎
Well explained. Thank you so much.
I really felt like I got a handle on escaping for the first time, thanks very much for the clear explanation! Briefly included in here was an example of your approach to closures. I think I have a mental block for closures, as I've reviewed them dozens of times and momentarily felt like I almost understood them, only to have the understanding slip away again. I guess what I'm wondering is whether there is a way to know, in this video for example before you introduce the asynchronous task in downloadData3, how to decide upon when and how to use closures and completion handlers. In any case, keep up the great work, I really appreciate your effort and attention to detail!
Your lessons are excellent!
Thanks Nolan!
Very very informative
lol.. love how you called "we went from this ugliness here" hahaha 🤣. Amazing tutorial as always Nick, Thanks!!
Wow, very concise and explained extremely clear
This is the only video i had watch twice to understand. Thanks nick..... ❤️✌️
Another very well explained video!
Well explained. ✅
super video .. very welll explained
Thank you so much Sikandar!
... after 14 minutes we saw the first example of code with escaping 🥳
Quite a clear explanation. Thanks a lot!
Well presented, but it still makes my head spin.
Thanks Pitmanra. Don't stress about this one too much, we're going to be using Combine most of the time anyway! You'll grasp this pretty easily when we start using it in apps :)
you are the best! Thank you so much
Thanks for watching!
Had to run through this a few times. Struggle with this - my bad - not bright enough!
more and more difficult, but well explained
We have to get into the hard stuff sooner or later haha Thanks again for the comment.
Thanks Nick! this tutorial really do helped me! By the way, I come to curious about a completion handler. As soon as completion handler is called, I understood that the bracket in the upper? function(like getDat function in the video) is called. Than, can I do something AFTER the completion function is completed? Like, writing more code after completionHandler("new data!") block in func downloadData2 Anyway, really easy and good tutorial!
Crystal clear
Hey Nick. I noticed something that's been reoccurring in a few of your videos and I'm guessing it's just an xcode update, but at 9:41 when you hit enter on the completions, xcode seems to add in parenthesis, whereas in mine, it does not. It doesn't seem to make a difference but still... Are the parenthesis unnecessary?
But then what is the difference between this and async? It seems there are two options to do things asynchronously.
Yes, there are 3 main ways actually. Using @escaping closures was the first evolution of Swift, then came Combine, and the newest is async/await. It’s important for iOS devs to know them all. Comparison here: ruclips.net/video/9fXI6o39jLQ/видео.htmlsi=34gCTbav25aw9gJC
This is a good question! Learning Swift with knowledge of Dart, I am not liking this syntax at all in terms of readability. As Nick is saying here, I understand that devs need to be able to read "old" code when working in teams, but as a solo dev, I definitely prefer to use async/await (just like Dart). So much cleaner, and so much more readable. Thanks for the explanation Nick! 👍
I’m not sure how many times I watched this video but I think finally I got it. Well I’ll let you know once I start typing code. What I want to do is start a function but as the function is running send out a status @State value to the view in real time. I’m hoping this method of escaping will do that? What do you think?
Hey Nick, in 5:17, why do you write let newData=downloadData() , then text=newData instead of writing directly text=downloadData() 🤔. Thank you
listen on 5:08, he explains why
I've been trying to understand this for 3 days now
Can you please share the code,It will be of great help.
github.com/SwiftfulThinking
Well my plan did not work. The code worked in that there were no errors but the @StateObject value would not display in the view in real time. I’m at a lost!
I've enjoyed your other videos but found this a bit lacking in depth. If the compiler can already tell you need @escaping through the error message why do you need to explicitly state it. Are there cases when you don't need to state it? What is @escaping actually doing?
@escaping is telling the compiler that this function we are passing it is going to “escape” the function it’s being called from. In other words, the function passed in can outlive the function it’s called within
Not doing it for me, this one!
Sorry Nick!
Thank you Nick , You are magnificent 🤎
ohh. it so complicated 🥲
You got this 🚀