Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Parus
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
DAloG
November 23, 2013
Programming
210
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Parus
Auto Layout in code.
DAloG
November 23, 2013
Transcript
57 slides
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)
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
260
Redux + MQTT
dalog
1
840
От задач к проблемам
dalog
1
300
Unlimited power of Data-Driven UI
dalog
4
720
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
440
Why unidirectional architecture matter for iOS.
dalog
1
350
Mobile backend without REST
dalog
2
160
Self managed teams 101
dalog
0
220
Other Decks in Programming
See All in Programming
TanStack Vue Query と Pinia Colada から学ぶ非同期状態の型設計
aoshi
0
660
はじめてのPLATEAU
nokonoko1203
1
640
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
SODA - FACT BOOK(EN)
sodainc
1
230
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
630
protojson における文字化けの扱い
kazuki1023
0
400
SODA - FACT BOOK(JP)
sodainc
1
40k
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
180
Seven New Principles of Software Engineering
yegor256
0
490
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
140
AI Augmentation Techniques with Liberty
ivargrimstad
1
460
Featured
See All Featured
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
580
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Test your architecture with Archunit
thirion
2
2.5k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
830
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
70
69k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
470
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
300
Odyssey Design
rkendrick25
PRO
3
940
Designing for Timeless Needs
cassininazir
1
560
The Limits of Empathy - UXLibs8
cassininazir
2
780