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
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
DAloG
November 23, 2013
Programming
200
1
Share
Parus
Auto Layout in code.
DAloG
November 23, 2013
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
230
Redux + MQTT
dalog
1
800
От задач к проблемам
dalog
1
280
Unlimited power of Data-Driven UI
dalog
4
690
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
410
Why unidirectional architecture matter for iOS.
dalog
1
320
Mobile backend without REST
dalog
2
140
Self managed teams 101
dalog
0
190
Other Decks in Programming
See All in Programming
Codex CLI でつくる、Issue から merge までの開発フロー
amata1219
0
340
飯MCP
yusukebe
0
490
iOS機能開発のAI環境と起きた変化
ryunakayama
0
170
安いハードウェアでVulkan
fadis
1
940
KagglerがMixSeekを触ってみた
morim
0
370
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
330
How Swift's Type System Guides AI Agents
koher
0
200
L’IA au service des devs : Anatomie d'un assistant de Code Review
toham
0
220
AI活用のコスパを最大化する方法
ochtum
0
380
[PHPerKaigi 2026]PHPerKaigi2025の企画CodeGolfが最高すぎて社内で内製して半年運営して得た内製と運営の知見
ikezoemakoto
0
340
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
300
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
760
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Accessibility Awareness
sabderemane
0
96
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
Leo the Paperboy
mayatellez
7
1.6k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
The Limits of Empathy - UXLibs8
cassininazir
1
290
Practical Orchestrator
shlominoach
191
11k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
110
Making Projects Easy
brettharned
120
6.6k
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)