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でリッチな演出に疲弊してるの?
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ryusuke Fuda
February 14, 2015
Programming
27k
9
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
まだiOSでリッチな演出に疲弊してるの?
iOSオールスターズ勉強会発表資料です。
Ryusuke Fuda
February 14, 2015
More Decks by Ryusuke Fuda
See All by Ryusuke Fuda
スタートアップのCTOとは
ryusukefuda
0
410
Other Decks in Programming
See All in Programming
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
340
Inside Stream API
skrb
1
700
不変条件と整合性境界—ビジネスが決める設計判断と実現パターン / Invariants and Consistency Boundaries
nrslib
13
3.8k
そのテスト、説明できますか?~LWテスト戦略FW~のご紹介
nakahara
0
110
dRuby over BLE
makicamel
2
330
Javaの型とAI時代に型が大事な理由 / java types and type in AI era
kishida
2
130
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
280
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
430
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
7
4.3k
OSもどきOS
arkw
0
560
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
230
「エンジニアインターン、どうやって取った?」準備のリアルを語るLT会 Progate BAR
akiomatic
0
130
Featured
See All Featured
The untapped power of vector embeddings
frankvandijk
2
1.8k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.4k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Into the Great Unknown - MozCon
thekraken
41
2.6k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
190
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.4k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
240
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
10
1.2k
Become a Pro
speakerdeck
PRO
31
6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
Transcript
·ͩiOSͰϦονͳԋग़ʹർฐͯ͠Δͷʁ ໘ന๏ਓ ΧϠοΫ ాོհ @ryusukefuda iOSΦʔϧελʔζษڧձ 14,Feb,2015
ΧϠοΫͷΞϓϦࣄ
ʲࣗࣾ։ൃʳ ʲडୗ։ൃʳ
ԋग़ɺػೳͱʹ ༷ʑͳͷ͕ΞϓϦʹ ٻΊΒΕΔ
ྫ͑
None
None
ർฐ…
ฐࣾઌഐ ʮͲ͏͠Α͏ͳ͘ͳͬͯԋग़ʹ ɹಈըΛͭͬ͜Μͩ͜ͱ͋ΔΑɻʯ
શͳΔർฐ…
Ϧονͳԋग़ ɾCoreAnimationʁ ɾUnityʁ ɾCocos2dʁ ɾLibraryʁ
ɾCoreAnimation ɾUnityɾCocos2d ɾLibrary ίʔυྔ૿͑Δ͠ɺେྔͷΦϒδΣΫτΛ ಈ͔͢ͷͱ͔େม…. ԋग़࡞Γ͍͚͢ͲɺωΠςΟϒͷػೳΛ ͍͍ͪͪϓϥάΠϯͰ͔͘ͷେม… ͕͍ࣗͨ͠ԋग़ݟ͔ͭΒͳ͍…
ଞͷํ๏ͳ͍ͷʁ
͏ʔΜ…
͋ͬ!!
SpriteKit
ͱ͍͏͜ͱͰɺ SpriteKitΛΞϓϦͷ ԋग़ʹͬͯΈ·ͨ͠
SpriteKitͱ iOS 7 ͔ΒՃ͞Εͨɺ Apple͕ఏڙ͍ͯ͠Δ ήʔϜ༻ͷϑϨʔϜϫʔΫ
ɾΠϯετʔϧෆཁ ɾXcodeͰϓϨϏϡʔ͠ͳ͕Β ɹύʔςΟΫϧฤूՄೳ ɾUIKitͱಉ͡Α͏ʹهड़Ͱ͖Δ ಛ
࣮ࡍɺSpriteKitΛ ήʔϜͰͳ͘ɺ UIKitϕʔεͷΞϓϦʹ ͑Δͷ͔ʁ
DEMO
Code https://github.com/ryusukefuda/SpriteKit-Demo
SKView SpriteKitΛදࣔ͢Δઐ༻ͷView SKScene( .sks) SKNodeΛܧঝ͠ɺϝΠϯͷॲཧΛߦ͏ɻ SKNode SpriteKitͷίΞͱͳΔΫϥε UIViewControllerͷΑ͏ͳͷ UIViewͷΑ͏ͳͷ NSObjectͷΑ͏ͳͷ
Step.1 ! ύʔςΟΫϧͭ͘Δ
SKSceneͱSKSceneͷαϒΫϥεΛ༻ҙ͠ɺ ύʔςΟΫϧͳͲԋग़ΛՃ͢Δ func fireHeart(point:CGPoint) { let path = NSBundle.mainBundle(). pathForResource("heartSpark",
ofType: "sks") let sceneData = NSData(contentsOfFile: path!, ɹɹɹɹɹɹɹɹɹɹɹɹɹɹoptions: .DataReadingMappedIfSafe, error: nil)! let particle = NSKeyedUnarchiver.unarchiveObjectWithFile(path!) as SKEmitterNode particle.position = point self.addChild(particle) } Step.2
SKViewΛͭ͘Γɺ UIViewControllerͷViewʹSKViewΛadd͢Δ let skView = SKView(frame: self.view.bounds) self.view.addSubview(skView) Step.3
͖ͳλΠϛϯάͰSKSceneΫϥεͷԋग़ΛݺͿ @IBAction func tapFavoriteButton(sender: AnyObject) { let scene = UIScene.unarchiveFromFile("UIScene")
as UIScene! let location = CGPointMake(sender.position.x - 50, sender.position.y) scene.fireHeart(location) } Step.4
SKActionͰύʔςΟΫϧʹΞχϝʔγϣϯΛ͚ͭΔ let scale = SKAction.scaleTo(1.0, duration: 1.0) let fadeout =
SKAction.fadeOutWithDuration(0.5) let remove = SKAction.removeFromParent() let sequence = SKAction.sequence([scale, fadeout,remove]) particle.runAction(sequence) Animation
UIKitϕʔεͷΞϓϦʹSpriteKit ΛՃ͢Δͱ͖ͷϙΠϯτ
UIViewͷ্ʹಁ໌ͷSKViewΛͷͤͯ SKViewͷλονΠϕϯτΛແޮʹ͢Δ skView.allowsTransparency = true ! skView.userInteractionEnabled = false UIView
SKView
UIViewͷ( 0,0 ) ͱSKViewͷ ( 0,0 ) ҧ͏ override func
touchesBegan(touches: NSSet, withEvent event: UIEvent) { ! for touch: AnyObject in touches { let location = touch.locationInView(self.view) scene.tapCircle(CGPointMake(location.x, self.view.bounds.height - location.y)) } } ! ( 0,0 ) UIView ( 0,0 ) SKView
SpriteKitΛͬͯΈͯ ɾApple͕ఏڙ͍ͯ͠Δ҆৺ײ ɾطଘͷίʔυͷअຐΛ͢Δ͜ͱͳ͘ɹɹ ɹಋೖͰ͖Δ ɾσβΠφʔ͞Μ͑Δ
·ͱΊ SpriteKitΛUIKitͱ Έ߹ΘͤΔͷ͋Γʂ
Ϧονͳԋग़Λ iOSωΠςΟϒͰɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ