Daily iOS
Concurrency

Run loop modes

While the user scrolls, an on-screen countdown Timer stops, and when scrolling ends it catches up all at once. From the run loop's point of view, what's the cause?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

During a scroll the main run loop runs in .tracking mode, and scheduledTimer is registered only in .default mode, so it can't fire in the meantime. The missed ticks get processed together once scrolling ends and the loop returns to .default.

Share a question