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
UISS
Search
Robert Wijas
November 14, 2013
Programming
0
110
UISS
Talk about my UISS library presented at Mobile Warsaw and CocoaHeads Cracow.
Robert Wijas
November 14, 2013
Tweet
Share
More Decks by Robert Wijas
See All by Robert Wijas
UISS Blitz Talk
robertwijas
0
120
The Lean Startup
robertwijas
0
150
Pomodoro Blitz Talk
robertwijas
2
160
Pomodoro
robertwijas
0
110
Other Decks in Programming
See All in Programming
破壊せよ!データ破壊駆動で考えるドメインモデリング / data-destroy-driven
minodriven
16
4.1k
Java ジェネリクス入門 2024
nagise
0
610
カスタムしながら理解するGraphQL Connection
yanagii
1
1.2k
シールドクラスをはじめよう / Getting Started with Sealed Classes
mackey0225
3
400
Sidekiqで実現する 長時間非同期処理の中断と再開 / Pausing and Resuming Long-Running Asynchronous Jobs with Sidekiq
hypermkt
6
2.7k
Content Security Policy入門 セキュリティ設定と 違反レポートのはじめ方 / Introduction to Content Security Policy Getting Started with Security Configuration and Violation Reporting
uskey512
1
430
CSC509 Lecture 08
javiergs
PRO
0
110
Outline View in SwiftUI
1024jp
1
160
OpenTelemetryでRailsのパフォーマンス分析を始めてみよう(KoR2024)
ymtdzzz
4
1.6k
Kubernetes for Data Engineers: Building Scalable, Reliable Data Pipelines
sucitw
1
200
Importmapを使ったJavaScriptの 読み込みとブラウザアドオンの影響
swamp09
4
1.2k
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
920
Featured
See All Featured
Fireside Chat
paigeccino
32
3k
Thoughts on Productivity
jonyablonski
67
4.3k
4 Signs Your Business is Dying
shpigford
180
21k
Unsuck your backbone
ammeep
668
57k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
How STYLIGHT went responsive
nonsquared
95
5.2k
Raft: Consensus for Rubyists
vanstee
136
6.6k
For a Future-Friendly Web
brad_frost
175
9.4k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
46
2.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.5k
Imperfection Machines: The Place of Print at Facebook
scottboms
264
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
25
1.8k
Transcript
Attractive things work better… When you wash and wax a
car, it drives better, doesn’t it? Or at least feels like it does. David A. Norman
Attractive things work better… When you wash and wax a
car, it drives better, doesn’t it? Or at least feels like it does. David A. Norman
Robert Wijas
Robert Wijas
Robert Wijas
Robert Wijas
None
None
UIAppearance on Steroids UISS
Quick introduction UIAppearance
Protocols @protocol UIAppearance <NSObject> ! + (id)appearance; ! + (id)appearanceWhenContainedIn:(Class
<UIAppearanceContainer>)ContainerClass, ... NS_REQUIRES_NIL_TERMINATION; ! @end ! ! @protocol UIAppearanceContainer <NSObject> @end
Properties - (void)setProperty:(PropertyType)property forAxis1:(IntegerType)axis1 axisN:(IntegerType)axisN; ! - (PropertyType)propertyForAxis1:(IntegerType)axis1 axisN:(IntegerType)axisN; #define
UI_APPEARANCE_SELECTOR
None
[[UIButton appearance] setTitleColor:[[UIColor whiteColor] colorWithAlphaComponent:0.800] forState:UIControlStateNormal]; [[UIButton appearance] setTitleColor:[UIColor whiteColor]
forState:UIControlStateHighlighted]; [[UIButton appearance] setBackgroundImage:[[UIImage imageNamed:@"button-background-normal"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0, 10.0, 0.0, 10.0)] forState:UIControlStateNormal]; [[UIButton appearance] setBackgroundImage:[[UIImage imageNamed:@"button-background-highlighted"] resizableImageWithCapInsets:UIEdgeInsetsMake(0.0, 10.0, 0.0, 10.0)] forState:UIControlStateHighlighted]; [[UILabel appearanceWhenContainedIn:[UIButton class], nil] setFont:[UIFont fontWithName:@"Copperplate-Bold" size:18.0]]; [[UIButton appearance] setTitleEdgeInsets:UIEdgeInsetsMake(1.0, 0.0, 0.0, 0.0)];
None
UISS JSON Syntax
UISS JSON Syntax "UIButton":{ "titleColor:normal":["white", 0.8], "titleColor:highlighted":"white", ! "backgroundImage:normal": ["button-background-normal",
[0,10,0,10]], "backgroundImage:highlighted": ["button-background-highlighted", [0,10,0,10]], ! "titleEdgeInsets": [1,0,0,0], ! "UILabel":{ "font":["Copperplate-Bold", 18] } }
"UIButton":{ "titleColor:normal":["white", 0.8], "titleColor:highlighted":"white", ! "backgroundImage:normal": ["button-background-normal", [0,10,0,10]], "backgroundImage:highlighted": ["button-background-highlighted",
[0,10,0,10]], ! "titleEdgeInsets": [1,0,0,0], ! "UILabel":{ "font":["Copperplate-Bold", 18] } } UIAppearance objects and containment
"UIButton":{ "titleColor:normal":["white", 0.8], "titleColor:highlighted":"white", ! "backgroundImage:normal": ["button-background-normal", [0,10,0,10]], "backgroundImage:highlighted": ["button-background-highlighted",
[0,10,0,10]], ! "titleEdgeInsets": [1,0,0,0], ! "UILabel":{ "font":["Copperplate-Bold", 18] } } Properties
"UIButton":{ "titleColor:normal":["white", 0.8], "titleColor:highlighted":"white", ! "backgroundImage:normal": ["button-background-normal", [0,10,0,10]], "backgroundImage:highlighted": ["button-background-highlighted",
[0,10,0,10]], ! "titleEdgeInsets": [1,0,0,0], ! "UILabel":{ "font":["Copperplate-Bold", 18] } } Axis parameters
"clear" [UIColor clearColor] ! ["#ffffff", 0.5] [UIColor colorWithRed:255.0f green:255.0f blue:255.0f
alpha:0.5f] ! [0, 255, 255, 0.5] [UIColor colorWithRed:0.0f green:255.0f blue:255.0f alpha:0.5f] Colors
14 [UIFont systemFontOfSize:14.0f] ! ["bold", 14] [UIFont boldSystemFontOfSize:14.0f] ! ["Georgia-Italic",
12] [UIFont fontWithName:@"Georgia-Italic" size:12.0f] Fonts
"imageName" [UIImage imageNamed:@"imageName"] ! ["imageName", 1, 2, 3, 4] [[UIImage
imageNamed:@"imageName"] resizableImageWithCapInsets:UIEdgeInsetsMake(1, 2, 3, 4)] Images
"UINavigationBar":{ "Phone":{ "tintColor":"gray" }, "Pad":{ "tintColor":"lightGray" } } UI Idiom
Branches
"Variables":{ "tint":"blue", “toolbar”:{ "tintColor": "$tint" } }, "UINavigationBar":{ "tintColor": "$tint"
}, "UITabBar":{ "tintColor": "$tint" }, "UIToolbar":”$toolbar” Variables
"UISSDemoViewController":{ "-UIButton":{ "titleColor:normal":["white", 0.8], "titleColor:highlighted":"white" } } Comments
None
None
Simple Setup
one line of code Simple Setup
Simple Setup [UISS configureWithDefaultJSONFile]; uiss.json
How to make it really cool?
How to make it really cool? Live updates
Remote Style [UISS configureWithDefaultJSONFile]
Remote Style [UISS configureWithURL:[NSURL URLWithString:@"http://localhost/uiss.json"]]
How-to Remote uiss.json
curl get.pow.cx | sh http://pow.cx
None
None
None
None
UIAppearance - (NSMutableArray *)_appearanceInvocations;
Swizzling TaggingAppearanceGeneralSetterIMP ()
When the magic happens
[UIView(Hierarchy) addSubview:] When the magic happens
- (void)reloadAppearance { NSArray * windows = [UIApplication sharedApplication].windows; for
(UIWindow *window in windows) { for (UIView *view in window.subviews) { [view removeFromSuperview]; [window addSubview:view]; } } } Reload appearance
None
UIAppearance weakness Selectors
subclassing UIAppearance weakness Selectors
subclassing UIAppearance weakness custom properties Selectors
Alternatives
Alternatives
Alternatives https://github.com/tombenner/nui
None
None
Layout
Layout Auto
attribute1 == multiplier × attribute2 + constant
attribute1 == multiplier × attribute2 + constant >= <= Left
Right Top Bottom Leading Trailing Width Height CenterX CenterY Baseline Left Right Top Bottom Leading Trailing Width Height CenterX CenterY Baseline @500
ASCII Art
|-[find]-[findNext]-[findField(>=20)]-| ASCII Art
None
Why bother?
None
None
None
None
None
http://github.com/robertwijas/UISS CocoaPods
inspired by @worrydream
None
robertwijas