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 light
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
DAloG
November 27, 2013
Programming
85
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Parus light
Light version of Parus presentation.
DAloG
November 27, 2013
Transcript
58 slides
None
Parus Mastering Auto Layout in code Dev-Pro TechTalk - 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
PV API Direct map.
A1 = A2*m + c
PV API A1 = A2*m + c
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) pliedTo
+ b • .plus(20) • .minus(50) pliedTo
A1 = A2*m + c
PV API A1 = A2*m + c
PV API PVVFL API PVGroup
PV API PVVFL API PVGroup
PVVFL Direct map.
PV API A1 = A2*m + c
PV API A1 = A2*m + c
PV API A1 = A2*m + c
PV API PVVFL API PVGroup
PVGroup C-C-C-Composition!
PVGroup( ). PVAttribute PVVFL NSLayoutConstraint Array of constraints Metrics, Views
None
PV API PVVFL API PVGroup
Some stats)
Questions? Feel free to contact: nobidon (Skype) +АлексейДемедецкий (Google+) @DAlooG
(Twitter) https://speakerdeck.com/dalog/parus-light
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
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
180
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
4.2k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
2
300
Crash Auto Pipelines
veronikapj
1
410
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
120
Modernizing iOS Apps
seyfoyun
0
150
LLM 101
dalinaum
0
480
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
2
140
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
260
小さなアプリを作って公開するまで
onozaty
0
170
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.3k
SODA - FACT BOOK(EN)
sodainc
1
230
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
900
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
33
5.7k
Statistics for Hackers
jakevdp
799
230k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
610
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
1
300
Java REST API Framework Comparison - PWX 2021
mraible
34
9.8k
How to Talk to Developers About Accessibility
jct
2
620
Game over? The fight for quality and originality in the time of robots
wayneb77
1
330
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.4k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
WENDY [Excerpt]
tessaabrams
15
40k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
980