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?
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?
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.
ConcurrencyShort answerIntro
In a UIKit screen you set label.text = result inside a network response callback, and…
#runloop #main-thread
Performance and debuggingShort answerAdvanced
You want to add a feature to your in-house APM that captures a stack whenever the main…
#runloop #main-thread
UIKitShort answerAdvanced
Each cell in a UITableView flash sale list shows a countdown like "Time left 00:12:34"…
#runloop #timer
CS fundamentals and algorithmsShort answerBasics
What's the difference between a process and a thread? What do threads share, and what…
#main-thread