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
260
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
480
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
750
Non-technical ways to be a better developer
icanzilb
1
360
What's in it after the Indiepocalypse is over?
icanzilb
1
2.7k
Animations with Auto Layout
icanzilb
1
160
SpriteKit with Swift workshop
icanzilb
1
1k
Other Decks in Technology
See All in Technology
Multitenant 23ai の全貌 - 機能・設計・実装・運用からマイクロサービスまで
oracle4engineer
PRO
2
150
OPENLOGI Company Profile
hr01
0
62k
スケールアップ企業のQA組織のバリューを最大限に引き出すための取り組み
tarappo
4
1.1k
”知のインストール”戦略:テキスト資産をAIの文脈理解に活かす
kworkdev
PRO
8
2.4k
Cline、めっちゃ便利、お金が飛ぶ💸
iwamot
20
19k
小さく始めるDevOps 内製化支援から見えたDevOpsの始め方 / 20250317 Ken Takayanagi
shift_evolve
1
120
Startups On Rails 2025 @ Tropical on Rails
irinanazarova
0
160
Road to SRE NEXT@仙台 IVRyの組織の形とSLO運用の現状
abnoumaru
1
450
20250325_Logic Apps / Power Automate の SharePoint コネクタの裏側を知る 〜Graph APIで直接操作してみよう〜
yutakaosada
0
110
滑らかなユーザー体験も目指す注文管理のマイクロサービス化〜注文情報CSVダウンロード機能の事例〜
demaecan
0
120
Amazon EKS Auto ModeでKubernetesの運用をシンプルにする
sshota0809
0
130
バックエンド留学した話/Backend study abroad story
kaonavi
0
120
Featured
See All Featured
Designing Experiences People Love
moore
141
23k
Reflections from 52 weeks, 52 projects
jeffersonlam
349
20k
Building a Scalable Design System with Sketch
lauravandoore
462
33k
Done Done
chrislema
183
16k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Typedesign – Prime Four
hannesfritz
41
2.6k
YesSQL, Process and Tooling at Scale
rocio
172
14k
Bash Introduction
62gerente
611
210k
We Have a Design System, Now What?
morganepeng
51
7.5k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
How to train your dragon (web standard)
notwaldorf
91
5.9k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
29
2k
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