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
3
240
Easy Animation at Cocoaheads Copenhagen
Slides from the Easy Animation talk at Cocoaheads Copenhagen
Marin Todorov
October 04, 2015
Tweet
Share
More Decks by Marin Todorov
See All by Marin Todorov
Testing RxRealm with RxBlocking
icanzilb
0
440
RxSwift on iOS
icanzilb
4
3.9k
Is RxSwift for me? @ try! Swift NYC
icanzilb
3
23k
(Appbuilders) Non-technical ways to be a better developer
icanzilb
3
720
Non-technical ways to be a better developer
icanzilb
1
340
What's in it after the Indiepocalypse is over?
icanzilb
1
2.7k
Animations with Auto Layout
icanzilb
1
150
SpriteKit with Swift workshop
icanzilb
1
960
Other Decks in Technology
See All in Technology
AI研修【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
130
ACRiルーム最新情報とAMD GPUサーバーのご紹介
anjn
0
150
コンテナ・K8s研修 - 前半 コンテナ基礎・ハンズオン【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
170
20240717_イケコパ代表Copilot_in_Teams会社でこう使ってます
ponponmikankan
2
430
楽しくGoを学び合う、LayerXの勉強会文化 / LayerX's study culture of having fun and learning Go together
ar_tama
2
350
DDDにおける認可の扱いとKotlinにおける実装パターン / authorization-for-ddd-and-kotlin-implement-pattern
urmot
4
390
MySQLのロックの種類とその競合
yoku0825
6
1.6k
運用改善、不都合な真実 / 20240722-ssmjp-kaizen
opelab
17
8k
サービスの持続的な成長と技術負債について
siva_official
PRO
10
4.4k
[NIKKEI Tech Talk] KDDI/KAG Scrum & Community for Engineering Training
curanosuke
2
220
エンジニアの生存戦略 〜クラウド潮流の経験から紐解く技術トレンドのメカニズムと乗りこなし方〜
shimy
9
1.9k
Git 研修 Basic【MIXI 24新卒技術研修】
mixi_engineers
PRO
0
310
Featured
See All Featured
Fontdeck: Realign not Redesign
paulrobertlloyd
79
5.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
42
2.7k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
16
1.6k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
23
1.9k
Making the Leap to Tech Lead
cromwellryan
127
8.7k
The Invisible Customer
myddelton
117
13k
[RailsConf 2023] Rails as a piece of cake
palkan
35
4.4k
Writing Fast Ruby
sferik
623
60k
StorybookのUI Testing Handbookを読んだ
zakiyama
15
4.9k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
26
1.6k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
325
21k
Gamification - CAS2011
davidbonilla
78
4.9k
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