Annotating a class or method with @MainActor ensures it always runs on the main thread.
← Swift theorytheory 0/50 · 0%
Concurrency · hard
38. MainActor
UI thread safety.
Check your understanding
1. Primary use?
2. Can be applied to a class?
UI thread safety.
Annotating a class or method with @MainActor ensures it always runs on the main thread.
1. Primary use?
2. Can be applied to a class?