⚠️ Xcode 13 beta 3 has introduced a breaking change in the async API, we now need to use `Task { }` instead of `async { }`
@akhterusman27342 жыл бұрын
Hu 86
@clickbaitking67703 жыл бұрын
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.
@itsmikeneas3 жыл бұрын
I really appreciated the video's progression, allowed me to connect all the dots :)
@damiragadilov40404 ай бұрын
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_pradeilles4 ай бұрын
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.
@veyselbozkurt92723 жыл бұрын
What a accent. Nice Video. Thank you
@rikudousenninn3 жыл бұрын
great videos man! keep going!
@salmansiddiqui95223 жыл бұрын
Can you make a video on asyncDetached and with priority
@v_pradeilles3 жыл бұрын
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 😅)