These videos and your whole channel is amazing. Simple, straightforward explanation about something that actually IS complicated! Thanks for your work!
Thank you Nick. I saw this in a codebase recently and had zero idea of what it means or does. You are a life saver. Anyway, it is the "get rid of this nonsense" for me at 20:56, Lmao!
Thanks for breaking this stuff down so well. It's finally starting to gel a bit in my mind. I have several functions with completion handlers in project that are called in sequence (ex: sequential alerts and completion handlers after animations) that will really benefit from this type of conversion to more linearly readable code. Much appreciated!
2:54 -- You don't need the do-catch at all -- you can just use try not in do block in a sthroign function as the error will bubble up til when the function's errors are handled
As always fantastically simple representation of what tends to be a confusing topic. On thing I might do for readabilty is use two guards instead of if, else if, else. But this is very much a personal preference thing.
In the previous videos - when we add the downloaded images to the [UIImage] array - why is it not necessary to do it in the main thread (Main Actor) ? Truly fantastic and educational videos BTW.
So.....this is basically alternative to using Combine? Interesting playlist but i remember that on Intermediate Playlist you said that Combine is the future of Swift. Is Concurrency actually better than Combine? When to use each of them? Is the performance difference that significant? Great playlist, tho. Learning a lot of new cool stuff! One more question. What do you think about Reactive Programming with f.ex RxSwift? Do you use that? Is it worth putting time on learing RxSwift?
Great questions, and I think the answer is basically chronological. RxSwift is a way of doing reactive programming and was introduced before Combine existed. I believe RxSwift supports iOS 9, while combine is only available iOS 13 and higher. If you’re working with SwiftUI, Combine is likely the way to go for reactive programming. Combine was introduced before Swift Concurrency existed. Now that we can use this, I’d say this is the best way to do asynchronous programming in Swift! In the final video of this series I take a few minutes to explain how Apple seems to be replacing Combine completely with Swift Concurrency features (although it’s not 100% there yet) 😜
@@SwiftfulThinking thanks for answer. I Get The point, but for newcomer in iOS development it might be confusing. What to learn? Combine? RxSwift? Concurrency? Optimal answer would probably be Concurrency but employers still look for skills in older Frameworks. Which framework would You recommend to learn first and use in portfolio apps?
Amazing video! I was really struggling getting my head around continuations. Just one quick question, I've read somewhere that after resuming a continuation we should set it to nil, is that true? And if so, why? Thanks!
Very nice series here. I'm learning a lot. Your GetData function at 5:23 could actually be a one liner like this: func getData(url: URL) async throws -> Data { try await URLSession.shared.data(from: url, delegate: nil).0 }
Hi Nick thanks for the amazing content and your great explanation skills. Is there a way to convert a function that its completion handler returns twice? for example in AWS AppSync the completion handler returns the cached data then returns again the updated data from backend I tried withCheckedContinuation but I got an error that it must resume only once. Thanks :)
No, not that I know of at least. I’ve had the same problem with some Firebase calls and have just been keeping those functions as completion handlers for now. One hacky solution would be to set up an @Published variable, have the completion handlers update the publisher, and separately have your await functions pointed to the publisher.
Hi Nick. Quick question, func getHeartImageFromDatabase() async -> UIImage doesn't use .resume() at the end. Could you tell me why is that ? Great content as always, thank you for your work.
Hi, you must have figured it out by now but for those who are wondering the answer for this question is that we need to call resume() method at the end of a URLSession.shared.dataTask for it to start working. We don't have a URLSession inside getHeartImageFromDatabase() so we don't need that like we did in getData2().
These videos and your whole channel is amazing. Simple, straightforward explanation about something that actually IS complicated! Thanks for your work!
Happy New Year and thank you for these tutorials. It's Jan 1st 7am where am at and your videos are the first thing I'm watching starting 2023.
It’s 3am here! Let’s go 🚀🚀🚀
Happy New Year 🤙
Thank you Nick. I saw this in a codebase recently and had zero idea of what it means or does. You are a life saver.
Anyway, it is the "get rid of this nonsense" for me at 20:56, Lmao!
😂😂😂
Thanks for breaking this stuff down so well. It's finally starting to gel a bit in my mind. I have several functions with completion handlers in project that are called in sequence (ex: sequential alerts and completion handlers after animations) that will really benefit from this type of conversion to more linearly readable code. Much appreciated!
after a long time, I come back to your videos, u look good my g!!! I like ur hairstyle
2:54 -- You don't need the do-catch at all -- you can just use try not in do block in a sthroign function as the error will bubble up til when the function's errors are handled
As always fantastically simple representation of what tends to be a confusing topic. On thing I might do for readabilty is use two guards instead of if, else if, else. But this is very much a personal preference thing.
Awesome video on how to reuse legacy code with our new async model. Thank you!
Wonderful explanations, much thanks ^^
You are beautiful!
Thanks for your work❤️
Hugs from Ukraine 🇺🇦
Awesome Job Nick!
amazing content, straight to the point and simple examples
In the previous videos - when we add the downloaded images to the [UIImage] array - why is it not necessary to do it in the main thread (Main Actor) ?
Truly fantastic and educational videos BTW.
It's amazing video again!!
You always let us easily to know the complicated things~~
thanks you so much
So.....this is basically alternative to using Combine?
Interesting playlist but i remember that on Intermediate Playlist you said that Combine is the future of Swift. Is Concurrency actually better than Combine? When to use each of them? Is the performance difference that significant?
Great playlist, tho. Learning a lot of new cool stuff!
One more question. What do you think about Reactive Programming with f.ex RxSwift? Do you use that? Is it worth putting time on learing RxSwift?
Great questions, and I think the answer is basically chronological. RxSwift is a way of doing reactive programming and was introduced before Combine existed. I believe RxSwift supports iOS 9, while combine is only available iOS 13 and higher. If you’re working with SwiftUI, Combine is likely the way to go for reactive programming. Combine was introduced before Swift Concurrency existed. Now that we can use this, I’d say this is the best way to do asynchronous programming in Swift! In the final video of this series I take a few minutes to explain how Apple seems to be replacing Combine completely with Swift Concurrency features (although it’s not 100% there yet) 😜
@@SwiftfulThinking thanks for answer. I Get The point, but for newcomer in iOS development it might be confusing. What to learn? Combine? RxSwift? Concurrency? Optimal answer would probably be Concurrency but employers still look for skills in older Frameworks. Which framework would You recommend to learn first and use in portfolio apps?
Great explanation!
Thanks! 🤙
Would it be a good idea to make a continuation from the Data.write(to:) function which may take some time?
Nick, are you able to do a video on Swift metatypes?
Amazing video! I was really struggling getting my head around continuations. Just one quick question, I've read somewhere that after resuming a continuation we should set it to nil, is that true? And if so, why? Thanks!
So juicy content.Thanks a lot 🙌
Very nice series here. I'm learning a lot. Your GetData function at 5:23 could actually be a one liner like this:
func getData(url: URL) async throws -> Data {
try await URLSession.shared.data(from: url, delegate: nil).0
}
awesome videos, much thanks
Hi Nick thanks for the amazing content and your great explanation skills.
Is there a way to convert a function that its completion handler returns twice? for example in AWS AppSync the completion handler returns the cached data then returns again the updated data from backend I tried withCheckedContinuation but I got an error that it must resume only once. Thanks :)
No, not that I know of at least. I’ve had the same problem with some Firebase calls and have just been keeping those functions as completion handlers for now. One hacky solution would be to set up an @Published variable, have the completion handlers update the publisher, and separately have your await functions pointed to the publisher.
Good stuff!
perfect video I've ever seen..!!
Almost all the APIs are now async but it is very easy to convert if they are not. No reason to keep using GCD.
Thanks for wonderful effort
Amazing content! Thanks for sharing that with us :-)
Hi Nick. Quick question, func getHeartImageFromDatabase() async -> UIImage doesn't use .resume() at the end. Could you tell me why is that ? Great content as always, thank you for your work.
Hi, you must have figured it out by now but for those who are wondering the answer for this question is that we need to call resume() method at the end of a URLSession.shared.dataTask for it to start working. We don't have a URLSession inside getHeartImageFromDatabase() so we don't need that like we did in getData2().
🔥
Cant wait to go home
thanks
gooodddddddd