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
AIエージェントで 変わるAndroid開発環境
takahirom
2
510
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
170
アルゴリズムは何を圧縮しているのか ─ Haskell から育った「圧縮代数」というメンタルモデル
naoya
16
3.3k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
360
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.7k
任せる範囲はこう広がった / How the Scope of AI Delegation Has Expanded
nrslib
1
250
ランチタイムLT会3周年!ランチタイムLT会を3年間続けられたお話
y0hgi
1
140
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
200
エンジニアにデザインハーネスを 〜デザインプロセスを規定するためのハーネス〜 / Design harness from an engineer's perspective
rkaga
2
1.4k
Contextとはなにか
chiroruxx
1
390
分散システム、なんですぐ死んでしまうん?耐障害性を高めたいあなたのためのレジリエンスパターン入門
mshibuya
7
5.7k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
840
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
34
9.5k
Paper Plane
katiecoart
PRO
2
52k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
First, design no harm
axbom
PRO
2
1.2k
Evolving SEO for Evolving Search Engines
ryanjones
0
240
Building AI with AI
inesmontani
PRO
1
1.1k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
460
Six Lessons from altMBA
skipperchong
29
4.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
180
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
380
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ωΠςΟϒͰɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ