High Performance Auto Layout
High Performance Auto Layout
WWDC 2018
updateConstraints()
Render Loop
Activating a Constraint
layoutSubviews()
Local vs Global Layout
Model The Problem Naturally
- Using constraints
- Don’t wedge two layouts into one set of constraints
Error Minimization
Engine is not perfect. The engine try to minimize errors.
Performance Intuition
- Don’t churn
- Basic algebra
- Engine is a layout cache and tracker
- You pay for what you use
Building Efficient Layouts
UIView.noIntrinsicMetric
To parent,
“hey I already have my size, don’t bother to do the text measurement”
System Layout Size Fitting Size
Unsatisfiable Constraints
- There is no solution for the specified constraints
- Logging will help you to debug
- Can mask other issues
- See related session for debugging tips