Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
Taming AutoLayout @sergioutama
Slide 2
Slide 2 text
Thinking Constraint “ It’s relationship between one view with another “
Slide 3
Slide 3 text
Center Y Center X height width baseline leading trailing top bottom A
Slide 4
Slide 4 text
Autolayout Component Priority Hugging and Compression
Slide 5
Slide 5 text
AutoLayout Frame ♥
Slide 6
Slide 6 text
view.translatesAutoresizingMaskIntoConstraints Follow the rules setNeedsUpdateConstraints() layoutSubviews() viewdidLayoutSubviews() autoresize layout pass setNeedsLayout() => super.setNeedsLayout()
Slide 7
Slide 7 text
Follow the rules “ superview only change it’s direct subviews “
Slide 8
Slide 8 text
Debug Autolayout ensure x, y, & size ensure priority set constraint identifier set view accessibility identifier
Slide 9
Slide 9 text
DEMO
Slide 10
Slide 10 text
Reference wwdc2015/218 wwdc2015/219 Apple AutoLayout Programming Guide
Slide 11
Slide 11 text
QA
Slide 12
Slide 12 text
Thank you @sergioutama