Pitfalls and best practices in Interface Building
summary
Condensed lessons from a thousand hours working with Interface Builder: explains intrinsicContentSize, contentCompressionResistancePriority (demo shows 1000 resisting a 998 squeeze) and contentHuggingPriority, and why those three make Auto Layout reliable across screen sizes. Recommends avoiding fixed width/height, constrain top-to-bottom and left-to-right, prefer UIStackView, build reusable xib components injected with five lines of code to add and pin subviews, use reusable table/collection cells and small view models (limit titles on a cell to three).
AI-written summary · about
chapters (10)
- 0:00Start
- 0:56Robust constraints
- 1:36Important Concepts
- 2:00Intrinsic Content Size
- 7:03Reusable Component Based Designs
- 7:51Do - create your views in separate .xib files
- 8:10Do - inject them into the view hierarchy with subclasses of UIView
- 8:48Don't - Specialize your UITableViewCell or UICollectionView classes
- 9:09Do - Create a generic ViewModel protocol that defines the content and look of your views
- 9:47Do - Specialize the ViewModels for ease of use
