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
850
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
Railsバージョンを4倍にした話
optim
0
560
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
1.8k
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
1
200
AWS CDKのカスタムリソースでContinuum(旧Security Agent)を実装した話 | Implementing Continuum (formerly Security Agent) via AWS CDK Custom Resource
akihisaikeda
2
160
パスワード再設定メールのURLについて知っておこう
uyuki234
0
180
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
120
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
200
JIS keyboard support in Omarchy
lef237
0
160
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.7k
golang-bob.pdf
iwatsukayura
0
140
PyConTW 2026 - AI Coding 不只是工具升級, 區域醫院醫療資訊系統協作開發與資訊團隊轉型實踐
cclai999
0
160
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
240
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
BBQ
matthewcrist
90
10k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.4k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
The SEO identity crisis: Don't let AI make you average
varn
0
590
技術選定の審美眼(2025年版) / Understanding the Spiral of Technologies 2025 edition
twada
PRO
120
120k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
490
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
How to Ace a Technical Interview
jacobian
280
24k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ