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
Nacho Soto's Slides at NSSpain 2013
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Luis Ascorbe
September 17, 2013
Programming
140
4
Share
Nacho Soto's Slides at NSSpain 2013
NSSpain is an iOS & OSX developers conference in Spain.
More info:
http://nsspain.com
Luis Ascorbe
September 17, 2013
More Decks by Luis Ascorbe
See All by Luis Ascorbe
Snapshot Testing at CMD+U Conf
lascorbe
2
150
Dave Verwer's Slides at NSSpain 2014
lascorbe
0
130
Andrew Yates' Slides at NSSpain 2014
lascorbe
0
120
Alberto Lopez's Slides at NSSpain 2014
lascorbe
0
44
Erik Erice's Slides at NSSpain 2014
lascorbe
0
100
Krzysztof Zabłocki's Slides at NSSpain 2013
lascorbe
8
450
Luis Solano's Slides at NSSpain 2013
lascorbe
3
140
Daniel Eggert's Slides at NSSpain 2013
lascorbe
8
220
Other Decks in Programming
See All in Programming
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
350
From Formal Specification to Property Based Test
ohbarye
0
2.4k
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
2.9k
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
19k
tRPCの概要と少しだけパフォーマンス
misoton665
2
270
AIと共に生きる技術選定 2026
sgash708
0
130
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
180
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
AIを導入する前にやるべきこと
negima
2
340
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
500
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
490
いつか誰かが、と思っていた フロントエンド刷新5年間の実践知
kiichisugihara
1
260
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
50
15k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
190
A better future with KSS
kneath
240
18k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Google's AI Overviews - The New Search
badams
0
1k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
190
The World Runs on Bad Software
bkeepers
PRO
72
12k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
300
GitHub's CSS Performance
jonrohan
1032
470k
Statistics for Hackers
jakevdp
799
230k
Crafting Experiences
bethany
1
140
Transcript
CREATING ANIMATIONS WITH CORE ANIMATION & CORE GRAPHICS Mobile Lead,
MindSnacks Inc. Creator of Sayonara app. Nacho Soto
AGENDA Animation types: Basic animations. Animating transforms. Using Paths. Keyframe
animations. Mixing things up with Core Graphics: Animating a programmatically drawn view. How to make it fast. • • • • • • • •
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:NSStringFromSelector(@selector(opacity))]; animation.fromValue = @0.0f; animation.toValue =
@1.0f; animation.duration = 5; [layer addAnimation:animation forKey:animation.keyPath]; BASIC ANIMATION
const CATransform3D transform = CATransform3DMakeScale(1, 0, 0); CABasicAnimation *animation =
[CABasicAnimation animationWithKeyPath:NSStringFromSelector(@selector(transform))]; animation.toValue = [NSValue valueWithCATransform3D:transform]; [layer addAnimation:animation forKey:animation.keyPath]; NOT SO BASIC ANIMATION
UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRect:rect]; CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:NSStringFromSelector(@selector(position))];
pathAnimation.path = bezierPath.CGPath; [layer addAnimation:pathAnimation forKey:pathAnimation.keyPath]; PATH ANIMATIONS
KEYFRAME ANIMATIONS CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"position.x"]; animation.values = [[NSArray
arrayWithRange:NSMakeRange(0, 100)] mapUsingBlock:^(NSNumber *number) { return @(pow(number.unsignedIntegerValue, 3) / 3000.f); }];
CORE ANIMATION + CORE GRAPHICS
WHY IS IT SLOW? I have the newest graphics card!
IT’S NOT ALL ABOUT THE GPU CoreGraphics.framework Quartz 2D Quartz
Services QuartzCore.framework Core Animation Core Image Rendering occurs in the CPU. Then textures are transferred to VRAM and composited there. We only have 1 / 60s (0.016s) to do all the work.
SO HOW DO WE MAKE RENDERING FASTER? DO NOT RENDER
NOT RENDERING MEANS CACHING Solution number 1: use stretchable images.
• Solution number 2: ? •
IDEA: Let’s render all the frames in advance. But, how
do we update the layer each frame?
SPRITE SHEETS
ABOUT ME Currently: Mobile Lead, MindSnacks Inc. Created Sayonara app.
Previously: Web and iOS developer at Ticketea.
[email protected]