Here’s a summary for WWDC 2017, Session 412: Auto Layout Techniques in Interface Builder
- Wrap the view containing its subviews and constraints all set, then set the height of this super view to 0, it gets the affects of hiding the elements;
xxxConstraint.isActive = false/truecome in pairs, set
isActive = falsefirst to avoid the warning message in console;
- To add some animation to this duration, use a UIView animation block to wrap layoutIfNeeded() as following:
- View position is a result of multiple properties:
frame: derived from constraints;
- Transform is great for temporary changes:
transformproperty offsets from frame;
CGAffineTransform = translation + rotation + scale; (Explore later)
- Reset to
- Fantastic method to debug dynamic type: Xcode -> Menu -> Accessibility Inspector -> Setting -> Drag&Drop Font Size;
- Check vertical baseline standard spacing for dynamic type.
- A new property in UIView;
- Available in tvOS;
- Title safe, unobscured content;
- iOS storyboards:
- Constraints automatically upgrade;
- Backwards deployable;
- LargeTitle support since iOS 11.0.
- Using spacer view is an nice option when needed in Interface Builder;
- Mark as hidden;
- Use UILayoutGuide programmatically.
- From Xcode 9, hidden property can vary by size class.