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
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.6k
AIを活用したE2Eテスト実装効率化のあゆみ / ebisu-mobile-14-kotetu
kotetuco
0
160
SREの積み重ねがAI駆動開発のガードレールになった ― 7つの実践/SRE Guardrails The 7
tomoyakitaura
7
1.1k
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
1
190
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
330
Vite+ Unified Toolchain for the Web
naokihaba
0
570
Agentic UI
manfredsteyer
PRO
0
220
「なぜそう決めたのか」を残し続ける仕組み ― Notion AI カスタムエージェント × Slack連携による設計判断の自動記録 - NIKKEI Tech Talk #47
niftycorp
PRO
0
250
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
630
dRuby over BLE
makicamel
2
410
LLM本来の能力を解き放つサンドボックス技術とAI民主化への適用
yukukotani
3
4.8k
Featured
See All Featured
Believing is Seeing
oripsolob
1
160
sira's awesome portfolio website redesign presentation
elsirapls
0
290
Game over? The fight for quality and originality in the time of robots
wayneb77
1
220
Tell your own story through comics
letsgokoyo
1
980
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
270
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.1k
The untapped power of vector embeddings
frankvandijk
2
1.8k
Into the Great Unknown - MozCon
thekraken
41
2.6k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
340
Bash Introduction
62gerente
615
220k
Navigating Weather and Climate Data
rabernat
0
270
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
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ωΠςΟϒͰɻ
͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ