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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
今日から始めるAmazon Bedrock AgentCore
har1101
4
400
あたらしい上流工程の形。 0日導入からはじめるAI駆動PM
kumaiu
5
760
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
330
日本の85%が使う公共SaaSは、どう育ったのか
taketakekaho
1
140
usermode linux without MMU - fosdem2026 kernel devroom
thehajime
0
220
Deno・Bunの標準機能やElysiaJSを使ったWebSocketサーバー実装 / ラーメン屋を貸し切ってLT会! IoTLT 2026新年会
you
PRO
0
300
Agile Leadership Summit Keynote 2026
m_seki
1
510
プロダクト成長を支える開発基盤とスケールに伴う課題
yuu26
4
1.3k
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
180
Context Engineeringの取り組み
nutslove
0
290
FinTech SREのAWSサービス活用/Leveraging AWS Services in FinTech SRE
maaaato
0
120
学生・新卒・ジュニアから目指すSRE
hiroyaonoe
2
560
Featured
See All Featured
Everyday Curiosity
cassininazir
0
130
Paper Plane (Part 1)
katiecoart
PRO
0
4k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
0
140
The browser strikes back
jonoalderson
0
360
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
26
3.3k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
Believing is Seeing
oripsolob
1
53
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.3k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
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