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
72
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
150
Redux + MQTT
dalog
1
730
От задач к проблемам
dalog
1
170
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
260
Mobile backend without REST
dalog
2
72
Self managed teams 101
dalog
0
120
Other Decks in Programming
See All in Programming
GoでParserを書く
karupanerura
3
280
PHPコードの実行モデルを理解する / Understanding-the-PHP-Execution-Model
shin1x1
0
1.1k
The Design of Everyday APIs - PyCon 2024
roguelynn
0
170
The grand strategy of Ruby Parser
yui_knk
5
280
GNU Makeの使い方 / How to use GNU Make
kaityo256
PRO
13
4.3k
Balkan Ruby 2024 — How and why to run SQLite on Rails in production
fractaledmind
0
110
TSKaigi 2024 - 新サービス Progate Path の演習で TypeScript を採用して見えた教材観点からの利点と課題
makotoshimazu
1
220
『WordPressコミュニティで学ぶ』OSS貢献の多様性
ippey
0
220
Next.js App Router
quramy
14
2.3k
最近コードレビューで指摘したこと
forrep
3
110
2024 コーディング研修
ckazu
2
650
RailsConf 2024: Riffing on Rails: sketch your way to better designed code
kaspth
1
210
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1357
200k
Into the Great Unknown - MozCon
thekraken
15
1.1k
Thoughts on Productivity
jonyablonski
60
3.9k
Optimising Largest Contentful Paint
csswizardry
13
2.4k
Building Applications with DynamoDB
mza
88
5.7k
Six Lessons from altMBA
skipperchong
22
3k
How STYLIGHT went responsive
nonsquared
92
4.8k
10 Git Anti Patterns You Should be Aware of
lemiorhan
649
58k
Web Components: a chance to create the future
zenorocha
306
41k
Designing on Purpose - Digital PM Summit 2013
jponch
111
6.5k
Put a Button on it: Removing Barriers to Going Fast.
kastner
58
3.1k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
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