Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
iOS で CSS スキニング
Search
Toshihiro Morimoto
June 22, 2013
Programming
1.4k
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
iOS で CSS スキニング
NUI を使って CSS スキニングしてみたお話
Toshihiro Morimoto
June 22, 2013
More Decks by Toshihiro Morimoto
See All by Toshihiro Morimoto
Xcode8 で開発はどうかわったのか
dealforest
10
6.6k
魅せるデバッグ技術
dealforest
4
1.6k
LLDB の世界からみた Swift
dealforest
4
5.6k
Xcode で快適なデバッグライフを追い求める
dealforest
29
25k
Intrducing debug in WWDC2016
dealforest
3
840
swift build と Xcode での Build の違い
dealforest
3
2.2k
RIP Xcode Plugin 🙏
dealforest
0
4.9k
Introducing Xcode Editor Extension
dealforest
2
4.7k
Introducing Anglerfish
dealforest
2
3.6k
Other Decks in Programming
See All in Programming
Vue Fes Japan 2026 タイムテーブル徹底解説
448jp
1
510
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
270
WebMCP Challenge に星空観察アプリで参加した話
okajun35
0
190
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
310
AWS Step Functions 大規模並列の壁を越える / jaws-sonic-2026-niigata-step-functions
kasacchiful
PRO
1
520
wkhtmltopdfの次どうするか問題2026
willnet
2
1.7k
Family mrubyの進捗
kishima
1
130
C#の現在地 進化の歴史と、AI時代の.NET Everywhere
neuecc
4
3.7k
アクセシビリティから考える情報設計
high_g_engineer
0
400
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
580
速習iPhone Duo対応
yuukiw00w
2
730
Featured
See All Featured
RailsConf 2023
tenderlove
30
1.6k
So, you think you're a good person
axbom
PRO
2
2.2k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Speed Design
sergeychernyshev
33
2.1k
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
250
New Earth Scene 8
popppiees
4
2.6k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
1k
Tell your own story through comics
letsgokoyo
1
1.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
3k
Transcript
iOS Ͱ CSS εΩχϯά @dealforest Toshihro Morimoto 2013/06/22 yidev@ौ୩ษڧձ ୈҰճ
ΞδΣϯμ • ࣗݾհ • Ϟνϕʔγϣϯ • ϥΠϒϥϦൺֱ • NUI ʹ͍ͭͯ
• ·ͱΊ
ࣗݾհ http://about.me/dealforest iOS ͷΞϓϦͭͬͨ͘Γ Ruby ॻ͍ͨΓ Perl ॻ͍ͨΓ Flash ͬͨΓͯ͠·ͨ͠
@dealforest Toshihro Morimoto
ϩδοΫͱελΠϧΛ ͍ͨ͠ Ϟνϕʔγϣϯ
ͦͦ σβΠϯΛमਖ਼͢ΔͨΊʹ ίʔυΛมߋ͢Δͷ ΊΜͲ͍͘͞
ʊਓਓਓਓਓਓਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹશମతʹϑΥϯταΠζมߋͯ͠ɹʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Yʉ
ʊਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹϑΥϯτ͜Εʹͯ͠ɹʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Y^Yʉ
ʊਓਓਓਓਓਓਓਓਓਓਓਓਓʊ ʼɹӨͷΦϑηοτͣΒͯ͠ɹʻ ʉY^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Yʉ
ͳΜͯ͜ͱ ৗ൧ࣄʹ͋Γ·͢Ͷ
Storyboard มߋͯ͠... nib ϑΝΠϧΛมߋͯ͠... ίʔυͰมߋͯ͠....
ͳΜͯຖճΓͨ͘ͳ͍!!
ͦΜͳ࣌ʹҰΧॴमਖ਼͢Ε શͯө͞ΕΕ͍͍ͷʹͳ...
ͦΕ͕Ͱ͖ΔͷͰ͢
UILabel ͷ߹ CGRect frame = CGRectMake(0, 0, 100, 100); UILabel
*label = [[UILabel alloc] initWithFrame:frame]; label.text = @"NUI demo"; label.font = [UIFont fontWithName:@"Helvetica" size:16]; label.textColor = [UIColor blueColor]; label.shadowColor = [UIColor grayColor]; label.shadowOffset = CGSizeMake(1, 1); label.textAlignment = NSTextAlignmentCenter; label.backgroundColor = [UIColor whiteColor];
UILabel ͷ߹ CGRect frame = CGRectMake(0, 0, 100, 100); UILabel
*label = [[UILabel alloc] initWithFrame:frame]; label.text = @"NUI demo"; // ↓ ͜Ε͔ΒԼελΠϧ label.font = [UIFont fontWithName:@"Helvetica" size:16]; label.textColor = [UIColor blueColor]; label.shadowColor = [UIColor grayColor]; label.shadowOffset = CGSizeMake(1, 1); label.textAlignment = NSTextAlignmentCenter; label.backgroundColor = [UIColor whiteColor];
NUI ༻ͨ͠ UILabel CGRect frame = CGRectMake(0, 0, 100, 100);
UILabel *label = [[UILabel alloc] initWithFrame:frame]; label.text = @"NUI demo"; label.nuiClass = @"SampleLabel"; SampleLabel { font-name: Helvetica; font-size: 16 font-color: blue; shadow-color: gray; shadow-offset: 1, 1; text-align: center; background-color: white; } NSSϑΝΠϧ
NUI Λ͏ͱ͜ͷΑ͏ʹ NSS ϑΝΠϧʹఆٛͯ͠ ཧ͢Δ͜ͱ͕Ͱ͖·͢
NUI Ҏ֎ʹϥΠϒϥϦ͕͋ΔͷͰ ·ͣͦΕΒΛܰ͘;Ε͍͖ͯ·͢
ϥΠϒϥϦൺֱ
ϥΠϒϥϦൺֱ •NimbusKit
ϥΠϒϥϦൺֱ •NimbusKit •NUI
ϥΠϒϥϦൺֱ •NimbusKit •NUI •Pixate
NimbusKit
NimbusKit • ৭ʑͱศརͳπʔϧ͕ೖͬͨϑϨʔϜ ϫʔΫ
NimbusKit • ৭ʑͱศརͳπʔϧ͕ೖͬͨϑϨʔϜ ϫʔΫ • CSS εΩχϯάʹ͍ͭͯͰ͖Δ͜ͱ ͕গͳ͗͢Δ UIAppearance Ͱͬͨํ͕Ϛγ
ࢦఆͰ͖ΔελΠϧ͜͜ʹҰཡ͕͋Γ·͢ http://docs.nimbuskit.info/group___c_s_s-_stylesheets.html
NUI
NUI • OSS (MIT License)
NUI • OSS (MIT License) • pading, margin ͳ͍ɻ͋͘·Ͱ০ͷΈ
NUI • OSS (MIT License) • pading, margin ͳ͍ɻ͋͘·Ͱ০ͷΈ •
version 0.2.5 Ҏ߱ iOS6 Ҏ্͕ඞਢ
NUI • OSS (MIT License) • pading, margin ͳ͍ɻ͋͘·Ͱ০ͷΈ •
version 0.2.5 Ҏ߱ iOS6 Ҏ্͕ඞਢ • iOS7 ରԠதͱͷ͜ͱ
Pixate
Pixate • NUI ΑΓɺΑΓ CSS ϥΠΫͳࢦఆ
Pixate • NUI ΑΓɺΑΓ CSS ϥΠΫͳࢦఆ • ແྉͰ͔ͭ͑ΔΑ͏ʹͳΓ·ͨ͠ɻ ͨͩ͠ඇӦརత͔ͭձࣾͩͱ10໊·Ͱ
Pixate • NUI ΑΓɺΑΓ CSS ϥΠΫͳࢦఆ • ແྉͰ͔ͭ͑ΔΑ͏ʹͳΓ·ͨ͠ɻ ͨͩ͠ඇӦརత͔ͭձࣾͩͱ10໊·Ͱ •
RubyMotion, Titanium, MonoTouch Ͱར༻Մೳ
Pixate • NUI ΑΓɺΑΓ CSS ϥΠΫͳࢦఆ • ແྉͰ͔ͭ͑ΔΑ͏ʹͳΓ·ͨ͠ɻ ͨͩ͠ඇӦརత͔ͭձࣾͩͱ10໊·Ͱ •
RubyMotion, Titanium, MonoTouch Ͱར༻Մೳ • Framework Ͱ͞ΕΔͷͰϒϥοΫϘοΫε
ελΠϧࢦఆͰ͖Δछྨͷɹ Pixate > NUI >>>> NimbusKit
ϥΠϒϥϦൺֱ
ϥΠϒϥϦൺֱ • Pixate ͩͱ pading, margin ΛࢦఆͰ͖Δά ϥσʔγϣϯࡉ͔͘ઃఆͰ͖Δ
ϥΠϒϥϦൺֱ • Pixate ͩͱ pading, margin ΛࢦఆͰ͖Δά ϥσʔγϣϯࡉ͔͘ઃఆͰ͖Δ • NUI
͋͘·ͰελΠϧͷΈɹɹɹɹɹ Ґஔௐ ࣗྗͰ͕ΜΔ
ϥΠϒϥϦൺֱ • Pixate ͩͱ pading, margin ΛࢦఆͰ͖Δά ϥσʔγϣϯࡉ͔͘ઃఆͰ͖Δ • NUI
͋͘·ͰελΠϧͷΈɹɹɹɹɹ Ґஔௐ ࣗྗͰ͕ΜΔ ͨͩ͠ Storyboard Λ͏͜ͱͰ ɹ ͦͷลΓͷࠩຒΊΕΔ
ݸਓతʹ storybord, nib Λ͏ͳΒ NUI Ͱ͍͍͔ͳͱࢥͬͯ·͢
ͱ͍͏Θ͚Ͱ͜Ε͔Β NUI ʹ͍ͭͯͰ͢
version 0.2.9
NUI Λ͏ͱ ͜͏͍͏͜ͱ͕ ؆୯ʹͰ͖·͢
before after
ηοτΞοϓ
CocoaPods༻࣌ Podfile platform :ios, '6.0' pod ‘NUI’ $ pod install
main.m int main(int argc, char *argv[]) { @autoreleasepool { [NUISettings
initWithStylesheet:@"NSSϑΝΠϧΛࢦఆ͢Δ"]; return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } }
AppDelegate.m - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { [NUIAppearance init]; ...
return YES; }
͜Ε͚ͩͰಈ͖·͢
ελΠϧͷॻ͖ํ @primaryFontNameBold: HelveticaNeue-Bold; @primaryFontSize: 17; Button { background-color: red; font-color:
#FFFFFF; font-color-highlighted: rgb(204, 204, 204) font-name: @primaryFontNameBold; font-size: @primaryFontSize; corner-radius: 6; }
ελΠϧͷॻ͖ํ @primaryFontNameBold: HelveticaNeue-Bold; @primaryFontSize: 17; BlueButton { background-color: blue; font-color:
#FFFFFF; font-color-highlighted: rgb(204, 204, 204) font-name: @primaryFontNameBold; font-size: @primaryFontSize; corner-radius: 6; }
https://github.com/tombenner/nui Կ͕ࢦఆͰ͖Δ͔ README Λࢀর͍ͯͩ͘͠͞
ελΠϧࢦఆํ๏
ελΠϧࢦఆํ๏ 1. ཁૉ(UIButton, UILabel ...)Λࢦఆͯ͠ελ ΠϧΛө͢Δ
ελΠϧࢦఆํ๏ 1. ཁૉ(UIButton, UILabel ...)Λࢦఆͯ͠ελ ΠϧΛө͢Δ 2. ಠࣗΫϥεΛఆٛͯ͠ελΠϧΛࢦఆ ͢Δ
1.ཁૉΛࢦఆͯ͠ελΠϧΛө͢Δ
1.ཁૉΛࢦఆͯ͠ελΠϧΛө͢Δ • NSS ϑΝΠϧͰఆٛ͢Δ
1.ཁૉΛࢦఆͯ͠ελΠϧΛө͢Δ • NSS ϑΝΠϧͰఆٛ͢Δ • શͯͷΠϯελϯεʹө͞ΕΔ
1.ཁૉΛࢦఆͯ͠ελΠϧΛө͢Δ • NSS ϑΝΠϧͰఆٛ͢Δ • શͯͷΠϯελϯεʹө͞ΕΔ • ఆ͕ٛͨ͠ಛఆͷΠϯελϯεʹελΠ ϧΛద༻͠ͳ͍ํ๏༻ҙ͞Ε͍ͯΔ (ྫ)
nuiClass = @”none”
2. ಠࣗΫϥεΛఆٛͯ͠ελΠϧΛࢦఆ͢Δ
2. ಠࣗΫϥεΛఆٛͯ͠ελΠϧΛࢦఆ͢Δ • NSS ϑΝΠϧͰఆٛͯ͠ Storyboard ͘͠ίʔυͰ nuiClass Λࢦఆ͢Δ
2. ಠࣗΫϥεΛఆٛͯ͠ελΠϧΛࢦఆ͢Δ • NSS ϑΝΠϧͰఆٛͯ͠ Storyboard ͘͠ίʔυͰ nuiClass Λࢦఆ͢Δ •
ΠϯελϯεຖʹελΠϧΛࢦఆ͢Δ
2. ಠࣗΫϥεΛఆٛͯ͠ελΠϧΛࢦఆ͢Δ • NSS ϑΝΠϧͰఆٛͯ͠ Storyboard ͘͠ίʔυͰ nuiClass Λࢦఆ͢Δ •
ΠϯελϯεຖʹελΠϧΛࢦఆ͢Δ • ελΠϧͷܧঝͰ͖Δ (ྫ) nuiClass=@”Label:TitleLabel”
StoryboardͰελΠϧΛࢦఆ
ίʔυͰελΠϧΛࢦఆ
ίʔυͰελΠϧΛࢦఆ CGRect frame = CGRectMake(0, 0, 100, 100); UILabel *label
= [[UILabel alloc] initWithFrame:frame]; label.nuiClass = @"titleLabel"; [self.view addSubview:label];
ίʔυͰελΠϧΛࢦఆ CGRect frame = CGRectMake(0, 0, 100, 100); UILabel *label
= [[UILabel alloc] initWithFrame:frame]; label.nuiClass = @"titleLabel"; [self.view addSubview:label]; CGRect frame = CGRectMake(0, 0, 100, 100); UILabel *label = [[UILabel alloc] initWithFrame:frame]; [NUIRenderer renderLabel:label withClass:@"titleLabel"]; [self.view addSubview:label];
ͱ͍͏͜ͱ্खʹཁૉΛࢦఆͯ͠ ελΠϧΛө͢Ε ݟͨΛҰؾʹ͔͑ΕΔͷͰʁʂ
αϯϓϧݟΔݶΓ ͜ΕͰ͍͚Δʂʂʂʂ
͍͚Δ...
...
ੈͷதͦΜͳ͋͘Γ·ͤΜͰͨ͠
ͦΜͳੈքݬͰͨ͠
ͱɺ͍͏Θ͚Ͱ ্ख͍͔͘ͳ͔ͬͨσϞͰ͢
before after Googolplex.NUI.nssΛ༻
σϞ
શମͷελΠϧΛมߋͨ͠ ࡍͷӨڹൣғ
before after UIActionSheet
before after UIActionSheet UIView ͷഎܠ৭ΛനͰ ࢦఆͨ͠Өڹ
before after UIActionSheet
before after UIActionSheet UILabel ͷจࣈ৭ΛനͰ ࢦఆͨ͠Өڹ
before after UIDatePicker
before after UIDatePicker UIView ͷഎܠ৭ΛനͰ ࢦఆͨ͠Өڹ
before after UIActivityViewController
before after UIActivityViewController UIButton ͷഎܠ৭ΛͰ ࢦఆͨ͠Өڹ
before after UIImagePickerController
before after UIImagePickerController CancelϘλϯΛมߋͰ͖ͳ͍
UISegmentedControl
UISegmentedControl webview ͷதͷ textfield ͷબ࣌Ͱ Өڹ͕ͰΔ
UIBarButtonItem
UIBarButtonItem UIBarButtonItemSystemItemΛ Λ͏ͱ UIButton ѻ͍ʹͳΔ
UIWebView
UIWebView UIWebView Ͱ textfield Λબ ͨ࣌͠ͷ Done Ϙλϯ UIBarButtonItem
·ͱΊ • શମͷελΠϧΛมߋͤ͞Δͷة ݥ͕͍ͬͺ͍ɻ ͳ͍ཁૉ͚ͩΛมߋ͢Δ (NavigationBar, BarButton, BarButtonBack ) •
େਓ͘͠ nuiClass Λࢦఆͯ͠ελΠ ϧΛө͠ͱ͍ͨํ͕ͤʹͳΓ·͢
͋͘·Ͱݱঢ়Ͱ͋Γόʔδϣϯ͕ ͕͋ΔͱཁૉΛࢦఆͯ͠มߋͯ͠ ͕ͳ͍Α͏ʹͳΔ͔...
ࠓޙʹظ
հͨ͠αϯϓϧ github ʹ͋Γ·͢ https://github.com/dealforest/workshops/tree/master/ 20130622_yidev
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ