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
170
Pomodoro
robertwijas
0
120
Other Decks in Programming
See All in Programming
短期間での新規プロダクト開発における「コスパの良い」Goのテスト戦略」 / kamakura.go
n3xem
2
170
良いユニットテストを書こう
mototakatsu
5
2k
テストコード文化を0から作り、変化し続けた組織
kazatohiei
2
1.5k
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
なまけものオバケたち -PHP 8.4 に入った新機能の紹介-
tanakahisateru
1
120
Beyond ORM
77web
5
520
Mermaid x AST x 生成AI = コードとドキュメントの完全同期への道
shibuyamizuho
0
160
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
140
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
120
Monixと常駐プログラムの勘どころ / Scalaわいわい勉強会 #4
stoneream
0
270
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
120
Semantic Kernelのネイティブプラグインで知識拡張をしてみる
tomokusaba
0
180
Featured
See All Featured
Visualization
eitanlees
146
15k
Thoughts on Productivity
jonyablonski
67
4.4k
Six Lessons from altMBA
skipperchong
27
3.5k
Git: the NoSQL Database
bkeepers
PRO
427
64k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
520
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Why Our Code Smells
bkeepers
PRO
335
57k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
127
18k
Faster Mobile Websites
deanohume
305
30k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
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