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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Marin Todorov
October 04, 2015
Technology
300
3
Share
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
540
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
790
Non-technical ways to be a better developer
icanzilb
1
410
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
実践ハーネスエンジニアリング:TAKTで実現するAIエージェント制御 / Practical Harness Engineering: AI Agent Control Enabled by TAKT
nrslib
6
1.3k
新規サービス開発におけるReact Nativeのリアル〜技術選定の裏側と実践的OSS活用〜
grandbig
2
200
Digitization部 紹介資料
sansan33
PRO
1
7.3k
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
猫でもわかるKiro CLI(CDKコーディング編)
kentapapa
1
110
ネットワーク運用を楽にするAWS DevOps Agent活用法!! / 20260421 Masaki Okuda
shift_evolve
PRO
1
120
生成AI時代のエンジニア育成 変わる時代と変わらないコト
starfish719
0
7.1k
Introduction to Bill One Development Engineer
sansan33
PRO
0
410
Amazon S3 Filesについて
yama3133
2
130
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」ご紹介資料
laysakura
0
2.3k
QGISプラグイン CMChangeDetector
naokimuroki
1
280
ある製造業の会社全体のAI化に1エンジニアが挑んだ話
kitami
2
990
Featured
See All Featured
sira's awesome portfolio website redesign presentation
elsirapls
0
210
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
B2B Lead Gen: Tactics, Traps & Triumph
marketingsoph
0
100
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
170
GitHub's CSS Performance
jonrohan
1032
470k
How to Talk to Developers About Accessibility
jct
2
170
BBQ
matthewcrist
89
10k
The SEO identity crisis: Don't let AI make you average
varn
0
440
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
180
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
340
Faster Mobile Websites
deanohume
310
31k
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