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
210
1
Share
Parus
Auto Layout in code.
DAloG
November 23, 2013
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
240
Redux + MQTT
dalog
1
820
От задач к проблемам
dalog
1
290
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
330
Mobile backend without REST
dalog
2
140
Self managed teams 101
dalog
0
200
Other Decks in Programming
See All in Programming
デフォルト運用のCodeRabbit、1年で何が変わったか / How CodeRabbit Changed Our Code Review in 1 Year
bake0937
1
110
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
420
OCRを使ってゲームのアイテムをデータ化する
kishikawakatsumi
0
120
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
210
Agentic UI beyond Chats Architecture Patterns & Open Standards @ngMunich 05/2026
manfredsteyer
PRO
0
160
Claspは野良GASの夢をみるか
takter00
0
130
今さら聞けないCancellationToken
htkym
0
200
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
460
柔軟なPDFレイアウトエディタを支える型システム設計 — Discriminated UnionとConditional Typeの実践
minako__ph
4
1.1k
LLM Plugin for Node-REDの利用方法と開発について
404background
0
130
Migrations : C'est une question d'hygiène !
vinceamstoutz
0
2.4k
Featured
See All Featured
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
120
What's in a price? How to price your products and services
michaelherold
247
13k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
350
Between Models and Reality
mayunak
4
310
Why Our Code Smells
bkeepers
PRO
340
58k
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
170
Test your architecture with Archunit
thirion
1
2.2k
sira's awesome portfolio website redesign presentation
elsirapls
0
260
Speed Design
sergeychernyshev
33
1.7k
Are puppies a ranking factor?
jonoalderson
1
3.4k
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)