Introduction
We use MainActor to make sure UI changes happen on the main thread. This keeps the app smooth and avoids crashes.
When updating labels or buttons after fetching data.
When changing the screen after a user taps a button.
When showing or hiding loading indicators.
When modifying any UI elements from background tasks.