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
The Rails Doctrine Decade
koic
2
420
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
180
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
400
AgentCore CLI で進化した AWS での AI エージェントの作り方 : 必要な機能を必要な時に
icoxfog417
PRO
4
400
すこし踏み込む CancellationToken
htkym
2
1.5k
FreeBSDでZabbixを動かす
kenkino
0
340
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
30
13k
mrbgem 三角測量 開発
ogom
0
150
速習iPhone Duo対応
yuukiw00w
2
910
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
280
Embedded Swiftで作る自作USBデバイス によるiOSデバイスの自動テスト / iOSDC Japan 2026 glassfiber
glassfiber
0
160
スマートフォンでモールス信号を送受信する 〜スマートフォンのLEDとカメラで作る光通信の設計と実装〜
atsuki_seo
0
210
Featured
See All Featured
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.9k
Scaling GitHub
holman
464
140k
Building Adaptive Systems
keathley
44
3.2k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
250
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
380
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
250
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
440
Utilizing Notion as your number one productivity tool
mfonobong
4
600
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
How Software Deployment tools have changed in the past 20 years
geshan
2
34k
Writing Fast Ruby
sferik
630
63k
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
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ