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 light
Search
DAloG
November 27, 2013
Programming
0
80
Parus light
Light version of Parus presentation.
DAloG
November 27, 2013
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
220
Redux + MQTT
dalog
1
790
От задач к проблемам
dalog
1
270
Unlimited power of Data-Driven UI
dalog
4
670
Data-Driven View Controllers. Tips and Tricks
dalog
5
2k
2 years of Redux in iOS. Lessons learned
dalog
0
390
Why unidirectional architecture matter for iOS.
dalog
1
310
Mobile backend without REST
dalog
2
130
Self managed teams 101
dalog
0
180
Other Decks in Programming
See All in Programming
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
FOSDEM 2026: STUNMESH-go: Building P2P WireGuard Mesh Without Self-Hosted Infrastructure
tjjh89017
0
150
AIで開発はどれくらい加速したのか?AIエージェントによるコード生成を、現場の評価と研究開発の評価の両面からdeep diveしてみる
daisuketakeda
1
970
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
190
組織で育むオブザーバビリティ
ryota_hnk
0
170
Architectural Extensions
denyspoltorak
0
270
Oxlintはいいぞ
yug1224
5
1.3k
Fluid Templating in TYPO3 14
s2b
0
130
AI Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
5.9k
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
270
Docker and Python
trallard
47
3.7k
The Invisible Side of Design
smashingmag
302
51k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
670
Odyssey Design
rkendrick25
PRO
1
490
Ethics towards AI in product and experience design
skipperchong
2
190
How STYLIGHT went responsive
nonsquared
100
6k
Balancing Empowerment & Direction
lara
5
880
Statistics for Hackers
jakevdp
799
230k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3k
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Transcript
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