Intermediate Swift
Q43 / 100

What is the @MainActor attribute?

Correct! Well done.

Incorrect.

The correct answer is B) Ensures that a type or function is accessed on the main thread, preventing UI mutations from background threads

B

Correct Answer

Ensures that a type or function is accessed on the main thread, preventing UI mutations from background threads

Explanation

@MainActor class ViewModel { } or @MainActor func updateUI() guarantees execution on the main actor, crucial for UI updates.

Progress
43/100