This example shows how to use MainActor in Swift to update UI safely from async code. The Task starts on a background thread. When calling updateLabel(), the code switches to MainActor (main thread) to update the label text. After the update, execution returns to the background thread and the Task completes. This ensures UI updates happen on the main thread, preventing crashes or visual bugs. The variable tracker shows label.text changes from empty to 'Hello, UI!' after the update. Key moments clarify why switching to MainActor is necessary and how 'await' pauses execution until the UI update finishes.