How to use Continuations in Swift (withCheckedThrowingContinuation) | Swift Concurrency #7

  Рет қаралды 16,054

Swiftful Thinking

Swiftful Thinking

Күн бұрын

Пікірлер: 39
@ObinnaAguwa-n5x
@ObinnaAguwa-n5x Жыл бұрын
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!
@SwiftfulThinking
@SwiftfulThinking Жыл бұрын
😂😂😂
@lucagfc
@lucagfc Жыл бұрын
These videos and your whole channel is amazing. Simple, straightforward explanation about something that actually IS complicated! Thanks for your work!
@danielcrompton7818
@danielcrompton7818 Ай бұрын
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
@krutomjer
@krutomjer 2 жыл бұрын
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.
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
It’s 3am here! Let’s go 🚀🚀🚀 Happy New Year 🤙
@richardhasson265
@richardhasson265 2 жыл бұрын
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!
@amith2947
@amith2947 2 жыл бұрын
after a long time, I come back to your videos, u look good my g!!! I like ur hairstyle
@josemanuelortizsanchez4983
@josemanuelortizsanchez4983 2 жыл бұрын
Awesome video on how to reuse legacy code with our new async model. Thank you!
@lincolndickerson1293
@lincolndickerson1293 2 жыл бұрын
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.
@tokero5199
@tokero5199 2 жыл бұрын
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 }
@光莒
@光莒 2 жыл бұрын
It's amazing video again!! You always let us easily to know the complicated things~~ thanks you so much
@keithweiss229
@keithweiss229 2 жыл бұрын
Awesome Job Nick!
@Y0sid0
@Y0sid0 3 ай бұрын
Wonderful explanations, much thanks ^^
@tbg6nb
@tbg6nb 2 жыл бұрын
amazing content, straight to the point and simple examples
@ПогореловИван-ж1р
@ПогореловИван-ж1р Жыл бұрын
You are beautiful! Thanks for your work❤️ Hugs from Ukraine 🇺🇦
@nithyavasudevan
@nithyavasudevan 11 ай бұрын
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.
@emirhan1356
@emirhan1356 5 ай бұрын
awesome videos, much thanks
@danielcrompton7818
@danielcrompton7818 6 ай бұрын
Would it be a good idea to make a continuation from the Data.write(to:) function which may take some time?
@maciusessa
@maciusessa 2 жыл бұрын
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?
@SwiftfulThinking
@SwiftfulThinking 2 жыл бұрын
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) 😜
@maciusessa
@maciusessa 2 жыл бұрын
@@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?
@BABEENGINEER
@BABEENGINEER 8 ай бұрын
Great explanation!
@SwiftfulThinking
@SwiftfulThinking 8 ай бұрын
Thanks! 🤙
@vimak
@vimak 2 жыл бұрын
So juicy content.Thanks a lot 🙌
@MauricioChavesDias
@MauricioChavesDias 2 жыл бұрын
Amazing content! Thanks for sharing that with us :-)
@jasondhindsa6774
@jasondhindsa6774 2 жыл бұрын
Nick, are you able to do a video on Swift metatypes?
@박성수-u3v
@박성수-u3v 2 жыл бұрын
perfect video I've ever seen..!!
@asadchattha3470
@asadchattha3470 9 ай бұрын
Thanks for wonderful effort
@fernandoivanperezruiz5144
@fernandoivanperezruiz5144 Жыл бұрын
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!
@cinquain0
@cinquain0 2 жыл бұрын
Good stuff!
@obsessed92
@obsessed92 2 жыл бұрын
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.
@gurcangulec
@gurcangulec Жыл бұрын
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().
@SiamakAshrafi
@SiamakAshrafi 2 жыл бұрын
Almost all the APIs are now async but it is very easy to convert if they are not. No reason to keep using GCD.
@pasha7324
@pasha7324 Жыл бұрын
🔥
@mhmtkrnlk
@mhmtkrnlk 2 жыл бұрын
Cant wait to go home
@cckelay
@cckelay Жыл бұрын
thanks
@KulturanCov
@KulturanCov 2 жыл бұрын
gooodddddddd
What is the Sendable protocol in Swift? | Swift Concurrency #11
17:09
Swiftful Thinking
Рет қаралды 15 М.
-5+3은 뭔가요? 📚 #shorts
0:19
5 분 Tricks
Рет қаралды 13 МЛН
How to use AsyncStream in Swift | Swift Concurrency #18
26:32
Swiftful Thinking
Рет қаралды 7 М.
How to use Global Actors in Swift (@globalActor) | Swift Concurrency #10
23:50
APIs for Beginners - How to use an API (Full Course / Tutorial)
2:19:33
freeCodeCamp.org
Рет қаралды 4,5 МЛН
JavaScript Pro Tips - Code This, NOT That
12:37
Fireship
Рет қаралды 2,5 МЛН
Swift Concurrency Manifesto | Chris Lattner and Lex Fridman
10:59
Swift Concurrency | How To Use async/await Like The PROS
14:12
Swift Closures Explained
14:23
Sean Allen
Рет қаралды 69 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
You hate DispatchQueue.main.async { } ? Good news, @MainActor killed it ☠️
11:51