Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Taming AutoLayout
Search
Sergio Utama
March 21, 2016
Programming
0
47
Taming AutoLayout
Initially presented during MyCocoaheads (
https://www.facebook.com/groups/mycocoaheads/
) meetup
Sergio Utama
March 21, 2016
Tweet
Share
More Decks by Sergio Utama
See All by Sergio Utama
Easy Way to Improve ReactNative
sergioutama
0
270
From try! Swift Tokyo 2017
sergioutama
0
64
Migrating to Swift 3
sergioutama
0
55
10 Things I learned while freelancing
sergioutama
0
59
iOS Video Player
sergioutama
0
86
Tribute to Mantle
sergioutama
0
30
Mobile Analytics
sergioutama
0
46
Other Decks in Programming
See All in Programming
非同期処理の迷宮を抜ける: 初学者がつまづく構造的な原因
pd1xx
1
700
Microservices rules: What good looks like
cer
PRO
0
1.2k
TypeScript 5.9 で使えるようになった import defer でパフォーマンス最適化を実現する
bicstone
1
1.3k
ゲームの物理 剛体編
fadis
0
330
30分でDoctrineの仕組みと使い方を完全にマスターする / phpconkagawa 2025 Doctrine
ttskch
3
800
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
TUIライブラリつくってみた / i-just-make-TUI-library
kazto
1
370
LLMで複雑な検索条件アセットから脱却する!! 生成的検索インタフェースの設計論
po3rin
2
660
Full-Cycle Reactivity in Angular: SignalStore mit Signal Forms und Resources
manfredsteyer
PRO
0
120
チームをチームにするEM
hitode909
0
300
Why Kotlin? 電子カルテを Kotlin で開発する理由 / Why Kotlin? at Henry
agatan
2
7k
ハイパーメディア駆動アプリケーションとIslandアーキテクチャ: htmxによるWebアプリケーション開発と動的UIの局所的適用
nowaki28
0
400
Featured
See All Featured
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
Done Done
chrislema
186
16k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.8k
BBQ
matthewcrist
89
9.9k
Thoughts on Productivity
jonyablonski
73
5k
The Invisible Side of Design
smashingmag
302
51k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
Music & Morning Musume
bryan
46
7k
Making Projects Easy
brettharned
120
6.5k
Writing Fast Ruby
sferik
630
62k
Embracing the Ebb and Flow
colly
88
4.9k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.8k
Transcript
Taming AutoLayout @sergioutama
Thinking Constraint “ It’s relationship between one view with another
“
Center Y Center X height width baseline leading trailing top
bottom A
Autolayout Component Priority Hugging and Compression
AutoLayout Frame ♥
view.translatesAutoresizingMaskIntoConstraints Follow the rules setNeedsUpdateConstraints() layoutSubviews() viewdidLayoutSubviews() autoresize layout pass
setNeedsLayout() => super.setNeedsLayout()
Follow the rules “ superview only change it’s direct subviews
“
Debug Autolayout ensure x, y, & size ensure priority set
constraint identifier set view accessibility identifier
DEMO
Reference wwdc2015/218 wwdc2015/219 Apple AutoLayout Programming Guide
QA
Thank you @sergioutama