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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
TAKTでAI駆動開発の品質を設計する
j5ik2o
7
1.4k
Datadog × OpenTelemetry 入門と実践のあいだ
kn_to_maxpno
1
160
Agentic UI
manfredsteyer
PRO
0
180
エージェンティックRAGにAWSで入門しよう!
har1101
8
1.7k
Language Server 使ってる? 〜VSCode と Zed の場合〜 / Are you using a Language Server? ~For VS Code and Zed~
handlename
0
790
技術記事、AIに書かせるか、自分で書くか? 〜それでも私が自分の手で書く理由〜 / #QiitaConference
jnchito
2
1.4k
AI 輔助遺留系統現代化的經驗分享
jame2408
1
780
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
6.2k
A2UI という光を覗いてみる
satohjohn
1
140
[2026年度第1回ORセミナー] 計画最適化ベンチャーと競技プログラミング人材
terryu16
0
270
DynamoDBには集計系のクエリがないけどなんとかしたい
musan
1
180
スマートグラスで並列バイブコーディング
hyshu
0
170
Featured
See All Featured
Art, The Web, and Tiny UX
lynnandtonic
304
22k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
230
The Hidden Cost of Media on the Web [PixelPalooza 2025]
tammyeverts
2
330
The Spectacular Lies of Maps
axbom
PRO
1
820
How to train your dragon (web standard)
notwaldorf
97
6.7k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
210
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
A Soul's Torment
seathinner
6
3k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.9k
Designing Experiences People Love
moore
143
24k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.2k
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ωΠςΟϒͰɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ