Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Speaker Deck
PRO
Sign in
Sign up for free
Easy Animation at Cocoaheads Copenhagen
Marin Todorov
October 04, 2015
Technology
3
210
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
350
RxSwift on iOS
icanzilb
4
3.7k
Is RxSwift for me? @ try! Swift NYC
icanzilb
3
22k
(Appbuilders) Non-technical ways to be a better developer
icanzilb
3
650
Non-technical ways to be a better developer
icanzilb
1
300
What's in it after the Indiepocalypse is over?
icanzilb
1
2.5k
Animations with Auto Layout
icanzilb
1
140
SpriteKit with Swift workshop
icanzilb
1
920
Other Decks in Technology
See All in Technology
Startup Studio Sereal / Culture Deck
sereal
0
630
本社オフィスを移転し、 オフィスファシリティ・コーポレートIT を刷新した話
rotomx
3
1.2k
インフラ技術基礎勉強会 開催概要
toru_kubota
0
140
AI Services 概要 / AI Services overview
oracle4engineer
PRO
0
160
グローバルチームことはじめ / Bootstrapping a global team
tasshi
1
640
Pentesting Password Reset Functionality
anugrahsr
0
220
私見「UNIXの考え方」/20230124-kameda-unix-phylosophy
opelab
0
160
CES_2023_FleetWise_demo.pdf
sparkgene
0
100
IoTを始めたきっかけの話と個人でできるIoTの今後 / 新年LT会「私の愛するIoT 2023」
you
0
150
GitHub Codespaces が拡げる開発環境、いつでもどこでも Visual Studio Code で!
dzeyelid
0
160
2年で10→70人へ! スタートアップの 情報セキュリティ課題と施策
miekobayashi
1
210
JAWS-UG 横浜 #54 資料
takakuni
0
180
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
57
6.6k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
2
390
Web development in the modern age
philhawksworth
197
9.6k
A Philosophy of Restraint
colly
193
15k
The Straight Up "How To Draw Better" Workshop
denniskardys
226
130k
Git: the NoSQL Database
bkeepers
PRO
418
60k
GraphQLとの向き合い方2022年版
quramy
20
9.8k
Designing with Data
zakiwarfel
91
4.2k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
500
130k
Rails Girls Zürich Keynote
gr2m
87
12k
Building Adaptive Systems
keathley
27
1.3k
Mobile First: as difficult as doing things right
swwweet
213
7.8k
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