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
iOS で CSS スキニング
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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.5k
魅せるデバッグ技術
dealforest
4
1.6k
LLDB の世界からみた Swift
dealforest
4
5.5k
Xcode で快適なデバッグライフを追い求める
dealforest
29
25k
Intrducing debug in WWDC2016
dealforest
3
820
swift build と Xcode での Build の違い
dealforest
3
2.1k
RIP Xcode Plugin 🙏
dealforest
0
4.9k
Introducing Xcode Editor Extension
dealforest
2
4.7k
Introducing Anglerfish
dealforest
2
3.5k
Other Decks in Programming
See All in Programming
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
720
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
11
5.9k
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
7.1k
Strategic Design in the Frontend: Moduliths & Micro Frontends @DDDEurope
manfredsteyer
PRO
0
110
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
170
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
260
A2UI という光を覗いてみる
satohjohn
1
140
Creating Composable Callables in Contemporary C++
rollbear
0
150
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
660
Featured
See All Featured
Mobile First: as difficult as doing things right
swwweet
225
10k
4 Signs Your Business is Dying
shpigford
187
22k
The Cult of Friendly URLs
andyhume
79
6.9k
Documentation Writing (for coders)
carmenintech
77
5.4k
Building Applications with DynamoDB
mza
96
7.1k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
220
Music & Morning Musume
bryan
47
7.2k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
150
Google's AI Overviews - The New Search
badams
0
1k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
540
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ