How do you go from completionHandler to async / await? 🤔

  Рет қаралды 2,625

Vincent Pradeilles

Vincent Pradeilles

Күн бұрын

Пікірлер
@v_pradeilles
@v_pradeilles 3 жыл бұрын
Did you find this tip useful? Are you planning on using it in your apps? Let me know in the comments 🚀
@dr.shrimppuertorico7467
@dr.shrimppuertorico7467 3 жыл бұрын
Yes, love your quick to the point videos.
@waheedafolabi6929
@waheedafolabi6929 3 жыл бұрын
It's very useful and even though I don't have a use case for it at the moment, it's saved in my playlist for easy reference.
@poesalec3330
@poesalec3330 3 жыл бұрын
How do I use async funtions in my app? When I have an async function getUsers which returns an array of users, how do I use that in my UIButton actions or viewDidLoad?
@v_pradeilles
@v_pradeilles 3 жыл бұрын
That's a good question! Short answer: you need to use the global `async()` function. There's a more detailed explanation in this article 👉 wwdcbysundell.com/2021/calling-async-apis-from-synchronous-contexts/
@waheedafolabi6929
@waheedafolabi6929 3 жыл бұрын
Thanks for the great content you are providing. I wondered why it took me so long to discover your channel. What's required to be an SDK developer? Could you build a full app where you show your thought process with implementation of SOLID principle and clean code architecture?
@developerios6096
@developerios6096 3 жыл бұрын
I wont negate (for me at least) this approach comes with additional complexity, or maybe its just because we are not confident with this new approach. I do understand some of the closure drawbacks, like retain cycles, pyramids of doom(which really destroy readability), but to me, if you have an easy task(i mean no complex, short amount of code) completion could still be considered the way to go. What you think Vincent? Would you replace all your completion based functions to follow this new approach? Good video anyway, you managed to handle the complexity making it a bit easier
@v_pradeilles
@v_pradeilles 3 жыл бұрын
Honestly I think Apple will push this pattern so much in their code examples and tutorials that it will become the norm in a couple of years. I agree that for the "simple" use case completionHandlers are quite nice, however they don't scale well and we know by experience that "simple" use case always tend to become more complex over the lifetime of a project...
@teamdjamodjamo2523
@teamdjamodjamo2523 3 жыл бұрын
J’adore l’accent français!!!
@jaqb17
@jaqb17 3 жыл бұрын
clousure
You hate DispatchQueue.main.async { } ? Good news, @MainActor killed it ☠️
11:51
No more [weak self] 🤯 (special video for the 1,000 subscribers)
13:35
Vincent Pradeilles
Рет қаралды 7 М.
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН
Правильный подход к детям
00:18
Beatrise
Рет қаралды 1,7 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
The Async Await Episode I Promised
12:04
Fireship
Рет қаралды 1,1 МЛН
Async/Await in Swift | Comparison vs Closures and Combine Framework
19:59
Meet the new alternative to Combine's Publisher! (it's called AsyncStream)
13:18
Why property Wrappers are so important in Swift?
17:47
Swift and Tips
Рет қаралды 1 М.
Running tasks in parallel using async/await 🚀
6:41
Vincent Pradeilles
Рет қаралды 3,9 М.
The KEY To Thinking Like a Programmer (Fix This Or Keep Struggling)
10:39
Lazy vars in Swift explained
9:21
donny wals
Рет қаралды 522
How to use MVVM with Async Await | Swift Concurrency #14
11:42
Swiftful Thinking
Рет қаралды 10 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 7 МЛН