Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Intermediate Auto Layout
Search
Peter Stuart
December 12, 2013
Technology
0
310
Intermediate Auto Layout
Talk given at CocoaHeads Boston.
Peter Stuart
December 12, 2013
Tweet
Share
Other Decks in Technology
See All in Technology
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
820
IaaS/SaaS管理における SREの実践 - SRE Kaigi 2026
bbqallstars
4
1.7k
Cosmos World Foundation Model Platform for Physical AI
takmin
0
440
データ民主化のための LLM 活用状況と課題紹介(IVRy の場合)
wxyzzz
2
680
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
6
68k
Digitization部 紹介資料
sansan33
PRO
1
6.8k
広告の効果検証を題材にした因果推論の精度検証について
zozotech
PRO
0
140
こんなところでも(地味に)活躍するImage Modeさんを知ってるかい?- Image Mode for OpenShift -
tsukaman
0
110
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
610
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
(金融庁共催)第4回金融データ活用チャレンジ勉強会資料
takumimukaiyama
0
140
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
420
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.3k
Utilizing Notion as your number one productivity tool
mfonobong
3
220
How Fast Is Fast Enough? [PerfNow 2025]
tammyeverts
3
450
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
53
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
64
Done Done
chrislema
186
16k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.7k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
Unsuck your backbone
ammeep
671
58k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
55
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Transcript
Intermediate Auto Layout
Layout Guides
Layout Guides id topLayoutGuide = self.topLayoutGuide; NSDictionary *views = NSDictionaryOfVariableBindings(topLayoutGuide,
someView); ... @"V:[topLayoutGuide]-[someView]" ...
Scroll Views
Scroll Views
Scroll Views [NSLayoutConstraint constraintWithItem:container attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:scrollView attribute:NSLayoutAttributeWidth multiplier:1 constant:0];
Scroll Views - (void)keyboardWillShow:(NSNotification *)notification { CGFloat offset = ...;
self.bottomConstraint.constant = offset; [UIView animate...:^{ [self.view layoutIfNeeded]; }]; }
Custom Views • Should know their intrinsic size • constraints
• intrinsicContentSize
Custom Views • Should know how to be laid out
• alignmentRectInsets
Custom Views return UIEdgeInsetsMake(25, 0, 0, 25); 1
Compression Resistance This is some pretty long text. Low High
High
Compression Resistance This is some … Low High High
Compression Resistance [view setContentCompressionResistancePriority:UILayoutPriorityDefaultLow forOrientation:UILayoutConstraintOrientationHorizontal];
Hugging Text Text Low High High Text
Hugging Text Text Low High High Text
Hugging [view setContentHuggingPriority:UILayoutPriorityDefaultLow forOrientation:UILayoutConstraintOrientationHorizontal] ;
Misc. • Align views/controls that contain text using NSLayoutAttributeBaseline, not
NSLayoutAttributeCenterY • Manage constraints with views, not view controllers • Avoid using explicit sizes