Рет қаралды 5,353
Hello guys, Welcome to another video!
In this video, we will learn how to use @MainActor to protect your mutable UI state and always send it to the main thread.
Content:
0:00 - Intro
0:19 - Why UI data must be sent to the main thread?
2:27 - Explaining demo
4:40 - Implementing MainActor
6:41 - Suspension points for actors
8:34 - More about concurrency
------
Source code showed in the video: github.com/pitt500/ActorsDemo...
------
Resources:
* Global actors: github.com/apple/swift-evolut...
* Actors (WWDC21): developer.apple.com/videos/pl...
* Apple: developer.apple.com/documenta...
* swift.org: docs.swift.org/swift-book/Lan...
------
Other videos in the channel:
* Async/await: • Async/Await in Swift |...
* Actors: • How do Actors work in ...
* Async Let: • How to download images...
-----
Don't forget to subscribe to the channel, like it, and follow me on social media:
Twitter:
/ swiftandtips
/ pitt500
Finally, ask me for a video you would like to see next 😄!
Credits:
- Music by Wataboi from pixabay.com/
- Video edited with LumaFusion