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
Parus
Search
DAloG
November 23, 2013
Programming
1
200
Parus
Auto Layout in code.
DAloG
November 23, 2013
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
200
Redux + MQTT
dalog
1
780
От задач к проблемам
dalog
1
260
Unlimited power of Data-Driven UI
dalog
4
650
Data-Driven View Controllers. Tips and Tricks
dalog
5
1.9k
2 years of Redux in iOS. Lessons learned
dalog
0
380
Why unidirectional architecture matter for iOS.
dalog
1
300
Mobile backend without REST
dalog
2
120
Self managed teams 101
dalog
0
160
Other Decks in Programming
See All in Programming
Developer Joy - The New Paradigm
hollycummins
1
370
バッチ処理を「状態の記録」から「事実の記録」へ
panda728
PRO
0
190
三者三様 宣言的UI
kkagurazaka
0
280
CSC305 Lecture 11
javiergs
PRO
0
300
PHPに関数型の魂を宿す〜PHP 8.5 で実現する堅牢なコードとは〜 #phpcon_hiroshima / phpcon-hiroshima-2025
shogogg
1
340
TransformerからMCPまで(現代AIを理解するための羅針盤)
mickey_kubo
7
5.6k
20251016_Rails News ~Rails 8.1の足音を聴く~
morimorihoge
3
860
オンデバイスAIとXcode
ryodeveloper
0
260
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
110
NixOS + Kubernetesで構築する自宅サーバーのすべて
ichi_h3
0
1.2k
3年ぶりにコードを書いた元CTOが Claude Codeと30分でMVPを作った話
maikokojima
0
650
はじめてのDSPy - 言語モデルを『プロンプト』ではなく『プログラミング』するための仕組み
masahiro_nishimi
4
16k
Featured
See All Featured
Learning to Love Humans: Emotional Interface Design
aarron
274
41k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Designing for Performance
lara
610
69k
Typedesign – Prime Four
hannesfritz
42
2.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
BBQ
matthewcrist
89
9.9k
Building a Scalable Design System with Sketch
lauravandoore
463
33k
Transcript
Parus Mastering Auto Layout in code UAMobile - 2013 by
DAloG
Intro UI Parts AL in general XIBs Parus
What is UI?
What is UI? Structure Layout Content
UI Components Structure Layout Content
Layout in the Wonderland
What if… Layout is intuitive Layout is simple Layout is
visual
What if… Layout is declarative Layout is compact
What we have?
XIBs Visual Intuitive Simple
XIBs Repetitive Static Unclear
Frames Controllable Powerful Clear
Frames Hard Verbose Static
Auto Layout
Relative Declarative Simple
A1 = A2 *m + c
A1 = A2 *m + c Left Right Top Bottom
CenterX/Y Baseline Width Height
Cassowary Will solve all your constraints
Cassowary Partial calculation Ambiguity detection Confilct detection
Ambiguity
Conflicts
AL in XIBs No conflicts No ambiguity No agility No
decarative.
AL in Code Verbose Not readable Mess Control.
None
Raw NSConstraint API ASCI VFL API XIB API
Masonry Chainable and declarative https:/ /github.com/cloudkite/Masonry
Masonry example
Summary Only raw api support. Custom syntax NIH (Not Invented
Here)
Raw NSConstraint API Masonry API ???
None
Parus DSL for NSConstraint creation https:/ /github.com/DAlOG/Parus
DSL Domain Specific Language.
Raw NSConstraint API ASCI VFL API
PV API PVVFL API PVGroup API
PV API Direct map.
A1 = A2 *m + c
None
A1 PV<Attr>Of(UIView* view) PVLeftOf(v) PVWidthOf(v) …
= .equal. .moreThan. .lessThan.
A2 .<Attr>Of(UIView* view) .leftOf(self) .rightOf(self) …
*m .multipliedTo(2.5) multipliedTo
+ b .plus(20) .minus(50) multipliedTo
A1 = A2 *m + c
None
PV API PVVFL API PVGroup API
PV API PVVFL API PVGroup API
PVVFL Direct map.
None
None
None
PV API PVVFL API PVGroup API
PVGroup C-C-C-Composition!
PVGroup( ). PVAttribute PVVFL NSLayoutConstraint Array of constraints Metrics, Views
None
PV API PVVFL API PVGroup API
Some stats)
Questions? Feel free to contact: nobidon (Skype) +АлекейДемедецкий (Google+) @DAlooG
(Twitter)