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
1
180
Parus
Auto Layout in code.
DAloG
November 23, 2013
Tweet
Share
More Decks by DAloG
See All by DAloG
State normalization (RU)
dalog
0
150
Redux + MQTT
dalog
1
730
От задач к проблемам
dalog
1
160
Unlimited power of Data-Driven UI
dalog
4
580
Data-Driven View Controllers. Tips and Tricks
dalog
5
1.7k
2 years of Redux in iOS. Lessons learned
dalog
0
320
Why unidirectional architecture matter for iOS.
dalog
1
250
Mobile backend without REST
dalog
2
72
Self managed teams 101
dalog
0
120
Other Decks in Programming
See All in Programming
Creating Retro-Style Photos Using Swift
ski
1
340
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
Building a Smaller App Binary
kateinoigakukun
2
200
オブジェクト指向コードレビューの新しいアプローチ
akkie76
3
1.5k
SwiftUI, Jetpack Composeの導入で変化した「家族アルバム みてね」のアプリ開発体験
hicka04
6
390
TCA魔法学入門🪄
dazy
0
280
実践!RDRAを活用した既存システムの仕様変更 / Specification Changes in Existing Systems Utilizing RDRA
imamotohikaru
0
2.5k
LPIXEL×CADDi_kaerururu
kaerururu
3
300
PHPでOfficeファイルを取り扱う! PHP Officeライブラリを プロダクトに組み込んだ話
hirobe1999
0
840
Kotlinを用いたDSL的な設計手法と使用上の注意
kohii00
3
530
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
220
Laravel標準バリデーションでできること
hmb_ok
2
360
Featured
See All Featured
JazzCon 2018 Closing Keynote - Leadership for the Reluctant Leader
reverentgeek
178
11k
Faster Mobile Websites
deanohume
296
30k
Git: the NoSQL Database
bkeepers
PRO
421
63k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
12
1.4k
Testing 201, or: Great Expectations
jmmastey
27
6.3k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
How To Stay Up To Date on Web Technology
chriscoyier
781
250k
Build your cross-platform service in a week with App Engine
jlugia
223
17k
Design by the Numbers
sachag
274
18k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
Why Our Code Smells
bkeepers
PRO
330
56k
Ruby is Unlike a Banana
tanoku
95
10k
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)