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
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Marin Todorov
October 04, 2015
Technology
3
290
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
530
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
400
What's in it after the Indiepocalypse is over?
icanzilb
1
2.8k
Animations with Auto Layout
icanzilb
1
180
SpriteKit with Swift workshop
icanzilb
1
1k
Other Decks in Technology
See All in Technology
新規事業における「一部だけどコア」な AI精度改善の優先順位づけ
zerebom
0
450
システムのアラート調査をサポートするAI Agentの紹介/Introduction to an AI Agent for System Alert Investigation
taddy_919
2
1.4k
Contract One Engineering Unit 紹介資料
sansan33
PRO
0
13k
CDK対応したAWS DevOps Agentを試そう_20260201
masakiokuda
1
130
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
370
GSIが複数キー対応したことで、俺達はいったい何が嬉しいのか?
smt7174
3
120
【インシデント入門】サイバー攻撃を受けた現場って何してるの?
shumei_ito
0
1.4k
15 years with Rails and DDD (AI Edition)
andrzejkrzywda
0
150
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.1k
All About Sansan – for New Global Engineers
sansan33
PRO
1
1.3k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
570
Sansan Engineering Unit 紹介資料
sansan33
PRO
1
3.8k
Featured
See All Featured
Prompt Engineering for Job Search
mfonobong
0
150
Automating Front-end Workflow
addyosmani
1371
200k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
240
Believing is Seeing
oripsolob
1
48
How to make the Groovebox
asonas
2
1.9k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
580
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
170
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Raft: Consensus for Rubyists
vanstee
141
7.3k
Designing for Performance
lara
610
70k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
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