Module 03 Β· Swift for Real Apps: Codable & Async β Lesson 4 of 4 Β· ~14 min
async/await: Waiting Without Freezing
The main thread
Everything your user sees runs on one lane of execution called the main thread. It redraws the screen up to 120 times a second, and it handles every tap, scroll, and animation. It's fast β as long as nobody makes it wait.
A network request to the PawWalk backend takes anywhere from 50 milliseconds to several seconds on hotel Wi-Fi. If the main thread stood still waiting for that response, the app would freeze: scrolling dies mid-flick, buttons ignore taps, spinners stop spinning. Users experience it as "the app is broken".
So the rule is: the main thread may start slow work, but it must never stand around waiting for it.