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
73
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
160
Redux + MQTT
dalog
1
760
От задач к проблемам
dalog
1
230
Unlimited power of Data-Driven UI
dalog
4
610
Data-Driven View Controllers. Tips and Tricks
dalog
5
1.8k
2 years of Redux in iOS. Lessons learned
dalog
0
340
Why unidirectional architecture matter for iOS.
dalog
1
270
Mobile backend without REST
dalog
2
88
Self managed teams 101
dalog
0
130
Other Decks in Programming
See All in Programming
ML.NETで始める機械学習
ymd65536
0
240
はじめての Go * WASM * OCR
sgash708
1
120
GoとPHPのインターフェイスの違い
shimabox
2
220
kintone開発を効率化するためにチームで試した施策とその結果を大放出!
oguemon
0
330
責務と認知負荷を整える! 抽象レベルを意識した関心の分離
yahiru
8
1.5k
1年目の私に伝えたい!テストコードを怖がらなくなるためのヒント/Tips for not being afraid of test code
push_gawa
1
650
Rails 1.0 のコードで学ぶ find_by* と method_missing の仕組み / Learn how find_by_* and method_missing work in Rails 1.0 code
maimux2x
1
260
The Clean ArchitectureがWebフロントエンドでしっくりこないのは何故か / Why The Clean Architecture does not fit with Web Frontend
twada
PRO
56
17k
なぜイベント駆動が必要なのか - CQRS/ESで解く複雑系システムの課題 -
j5ik2o
14
4.8k
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
950
お前もAI鬼にならないか?👹Bolt & Cursor & Supabase & Vercelで人間をやめるぞ、ジョジョー!👺
taishiyade
7
4.2k
やっと腹落ち「スプリント毎に動くモノをリリースする」〜ゼロから始めるメガバンクグループのアジャイル実践〜
sasakendayo
0
140
Featured
See All Featured
Producing Creativity
orderedlist
PRO
344
40k
Automating Front-end Workflow
addyosmani
1369
200k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.2k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
134
33k
Fireside Chat
paigeccino
35
3.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
29
1.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Making the Leap to Tech Lead
cromwellryan
133
9.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
328
24k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
11
540
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