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
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
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
1.1k
今さら聞けない .NET CLI
htkym
0
200
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
490
楽しそうなつよつよエンジニアと目が死んでる僕/A brilliant engineer having a blast, and dead-eyed me.
3l4l5
2
200
「寝てても仕事が進む」Claude Codeで組む第二の脳
tomoyafujita2016
0
340
引き算の組織 ― アウトカムとAIに全振りするために辞めたこと ― / Organization by Subtraction
hirokiyamamoto14
PRO
0
260
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
130
Jindong: Introducing Declarative Haptics in Compose Multiplatform
l2hyunwoo
0
120
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
500
Go を使い始めて 2 ヶ月の学び / My first two months with Go
contour_gara
0
260
仕様駆動開発の消費期限
watany
20
8.8k
MySQLとPostgreSQLって何が違うの?
akagami
0
120
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
660
It's Worth the Effort
3n
188
29k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
350
Amusing Abliteration
ianozsvald
1
250
What's in a price? How to price your products and services
michaelherold
247
13k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
250
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Bootstrapping a Software Product
garrettdimon
PRO
306
120k
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
470
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
170
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ωΠςΟϒͰɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ