Main thread and UI
In a UIKit screen you set label.text = result inside a network response callback, and sometimes the screen updates late or not at all. What's causing that?
In a UIKit screen you set label.text = result inside a network response callback, and sometimes the screen updates late or not at all. What's causing that?
The URLSession callback arrives on a background queue, so you touched the UI from a background thread. UIKit isn't thread safe and rendering is tied to the main run loop, so updates get dropped, delayed, or crash.
ConcurrencyShort answerBasics
While the user scrolls, an on-screen countdown Timer stops, and when scrolling ends it…
#main-thread #runloop
Performance and debuggingShort answerAdvanced
You want to add a feature to your in-house APM that captures a stack whenever the main…
#main-thread #runloop
ConcurrencyShort answerAdvanced
In Swift Concurrency, what's the difference between putting @MainActor on a whole view…
#ui
CS fundamentals and algorithmsShort answerBasics
What's the difference between a process and a thread? What do threads share, and what…
#main-thread