This example shows a Swift function marked with @MainActor, which means it must run on the main thread. When we call this function inside a Task, which runs on a background thread, Swift automatically switches to the main thread before running the function. The execution_table traces each step: defining the function, starting the Task, switching threads, running the function, and completing the Task. The variable_tracker shows the function's state changes. Key moments clarify why the thread switch happens and the need for await. The visual quiz tests understanding of thread switching and function execution. Overall, @MainActor helps keep UI updates safe by running code on the main thread.