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
Easy Animation at Cocoaheads Copenhagen
Search
Marin Todorov
October 04, 2015
Technology
310
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Easy Animation at Cocoaheads Copenhagen
Slides from the Easy Animation talk at Cocoaheads Copenhagen
Marin Todorov
October 04, 2015
More Decks by Marin Todorov
See All by Marin Todorov
Testing RxRealm with RxBlocking
icanzilb
0
550
RxSwift on iOS
icanzilb
4
4k
Is RxSwift for me? @ try! Swift NYC
icanzilb
3
23k
(Appbuilders) Non-technical ways to be a better developer
icanzilb
3
810
Non-technical ways to be a better developer
icanzilb
1
430
What's in it after the Indiepocalypse is over?
icanzilb
1
2.8k
Animations with Auto Layout
icanzilb
1
190
SpriteKit with Swift workshop
icanzilb
1
1.1k
Other Decks in Technology
See All in Technology
生成 AI 時代にいま一度「問い合わせ」について考えてみる
kazzpapa3
1
130
AI時代のPlaywright活用(システムテストを自動化する ー 実行エンジンにPla ywrightを選んだ理由)
ynisqa1988
2
950
Claude Mythos、Fable...フロンティアAIの最新動向と企業のセキュリティ対策
flatt_security
0
100
ファミコンでPHPを動かす / PHP on the Famicom
tomzoh
2
620
文字起こし基盤の信頼性
abnoumaru
0
120
AIとハーネスで育てるトランスコンパイラ / 20260722 Yasushi Katayama
shift_evolve
PRO
3
790
探索・可視化・自動化を一本化 Amazon Quickでデータ活用スピードを上げる方法
koheiyoshikawa
0
180
AI時代の開発生産性は、個人技からチーム設計へ
moongift
PRO
4
2.5k
reFACToring
moznion
0
200
なぜ、あなたのAPIは使われないのか? AX時代の設計原則、ガードレール、運用体制
yokawasa
1
210
AIが当たり前の組織で エンジニアはどう育つか
nishihira
1
990
SoccerMaster: A Vision Foundation Model for Soccer Understanding
kzykmyzw
0
170
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
510
Facilitating Awesome Meetings
lara
57
7k
The Cost Of JavaScript in 2023
addyosmani
55
10k
What does AI have to do with Human Rights?
axbom
PRO
1
2.3k
Code Reviewing Like a Champion
maltzj
528
40k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.6k
How STYLIGHT went responsive
nonsquared
100
6.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
Chasing Engaging Ingredients in Design
codingconduct
0
240
GitHub's CSS Performance
jonrohan
1033
470k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
64
56k
Transcript
Easy Animation Marin Todorov
Swift 2.0 Swift 2.0
None
Motivation
Motivation How would I improve the built-in animation APIs?
Goals * easier layer animations * easier animation sequences *
layer spring animations
David Rönnqvist post on objc.io
UIView.animateWithDuration(1.0, animations: { }) Create an animation context Destroy the
animation context Original animations block Animate layer properties
CALayer() UIView() layer layer view delegate
animations block view.alpha = 0.5 layer.position.y = 200 layer.cornerRadius =
50 UIView.actionForLayer(layer, “alpha”) CAAnimation UIView.actionForLayer(layer, “position.y”) CAAnimation UIView.actionForLayer(layer, “cornerRadius”) NSNull
layer.cornerRadius = 50 CABasicAnimation(keyPath: “cornerRadius”) toValue = 50 fromValue =
<current value>
Layer animations
Goals * easier layer animations * easier animation sequences *
layer spring animations
UIView.animationWithDuration(1.0, animations: { first animation }).animateWithDuration(1.0, { second animation })…
etc …
Sequence animations
Goals * easier layer animations * easier animation sequences *
layer spring animations
UIKit.animateWithDuration(…) CABasicAnimation UIKit.animateWithDuration(… springDamping: , springInitialVelocity: …) CASpringAnimation on iOS9
RBBSpringAnimation on iOS8
Feelings
Gotchas * Premature completion! * What is a damped harmonic
oscillator? * Retain/release #$!
What’s next? UIView.animateWithDuration(1.0, animations: { }) self.myButton.animationPath = CGPath(…) self.myButton.transform.scale.x
= 1.2 self.myButton.rotation = M_PI_4
How bout smth crazy? UIView.animateWithDuration(1.0, animations: { }) self.myButton.center.x =
20 Update the view constraints and thus make this work on AL? Whaaaa?
Marin Todorov Thank you! www.underplot.com