When did my view layout?
summary
Claims that UIKit schedules layout at specific run loop points driven by sources and observers. Demonstrates with a single-button breakpoint and stack trace, uses a simplified run-loop prototype and run loop observers to show when layout runs; finds layout sometimes occurs in source callbacks rather than only observer end-of-cycle, and that forcing layout disables UIKit optimizations. Tools: breakpoints, stack traces, a single-button demo and a fake run loop; results: clarifies timing and gives concrete rules.
AI-written summary · about
chapters (9)
- 0:00Layout timing mysteries
- 1:31UIKit layout computation
- 3:21Main thread and run loop
- 6:38Run loop sources and observers
- 8:47When layout happens
- 10:13Practical advice
- 11:18Run loops in iOS apps
- 12:23Applying knowledge daily
- 13:07Run loop research challenges








