You hate DispatchQueue.main.async { } ? Good news, @MainActor killed it ☠️

  Рет қаралды 4,253

Vincent Pradeilles

Vincent Pradeilles

Күн бұрын

Пікірлер: 13
@v_pradeilles
@v_pradeilles 3 жыл бұрын
⚠️ Xcode 13 beta 3 has introduced a breaking change in the async API, we now need to use `Task { }` instead of `async { }`
@akhterusman2734
@akhterusman2734 2 жыл бұрын
Hu 86
@clickbaitking6770
@clickbaitking6770 3 жыл бұрын
It works like this because UIViewController is annotated with @MainActor, and the async {}/Task {}function inherits the local actor context, which in this case is the MainActor. asyncDetached {} / Task.detached {} however does not inherit the local actor context, which is why you need to mark an await, a suspension point.
@itsmikeneas
@itsmikeneas 3 жыл бұрын
I really appreciated the video's progression, allowed me to connect all the dots :)
@damiragadilov4040
@damiragadilov4040 4 ай бұрын
I have for a question regarding the usage of async {} in the viewdidload while awaiting for the asynchronous method getData Why do not use Task {}? Are async better at this stage? Or is it just the preference?
@v_pradeilles
@v_pradeilles 4 ай бұрын
Yes you're absolutely right: you should use Task {} 👍 If I remember correctly, async {} was a syntax that was present during the beta period of Swift Concurrency. (which is when this video was released) I don't even think it's available anymore.
@veyselbozkurt9272
@veyselbozkurt9272 3 жыл бұрын
What a accent. Nice Video. Thank you
@rikudousenninn
@rikudousenninn 3 жыл бұрын
great videos man! keep going!
@salmansiddiqui9522
@salmansiddiqui9522 3 жыл бұрын
Can you make a video on asyncDetached and with priority
@v_pradeilles
@v_pradeilles 3 жыл бұрын
I’m taking good note 📝 (But I'm going to wait for the beta to end, because the API is way to unstable until then 😅)
@donathmm3881
@donathmm3881 3 жыл бұрын
Thank You
@rohitdhawan02
@rohitdhawan02 3 жыл бұрын
Thanks
How do you go from completionHandler to async / await? 🤔
12:23
Vincent Pradeilles
Рет қаралды 2,6 М.
When do we REALLY need to use [weak self]? 🤔
7:30
Vincent Pradeilles
Рет қаралды 8 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Your Brain 🧠 on Swift Concurrency - iOS Conf SG 2023
30:38
iOS Conf SG
Рет қаралды 11 М.
go is great i hate it
14:44
SST
Рет қаралды 28 М.
How to use Actors and non-isolated in Swift  | Swift Concurrency #9
29:31
Swiftful Thinking
Рет қаралды 22 М.
Swift API Calls for Beginners (Networking) - Async Await & JSON
25:35
Swift Tips #35 - reduce
6:26
Vincent Pradeilles
Рет қаралды 4,6 М.
Threads and Grand Central Dispatch in Swift
22:14
Stewart Lynch
Рет қаралды 22 М.
3 MISTAKES to avoid when using Async / Await in Swift 😌
4:41
Vincent Pradeilles
Рет қаралды 12 М.
How to treat Acne💉
00:31
ISSEI / いっせい
Рет қаралды 108 МЛН