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
Luis Ascorbe
September 17, 2013
Programming
140
4
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
45
Erik Erice's Slides at NSSpain 2014
lascorbe
0
100
Krzysztof Zabłocki's Slides at NSSpain 2013
lascorbe
8
460
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
Creating Composable Callables in Contemporary C++
rollbear
0
150
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
250
1B+ /day規模のログを管理する技術
broadleaf
0
100
過去最大のMCPアップデート! 2026-07-28 RC版の謎に迫る
licux
6
370
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
710
Spec Driven Development | AI Summit Lisbon
danielsogl
PRO
0
200
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
3
850
ADKを使って簡単にAIエージェントを作ってみよう
k1mu21
0
270
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
AIとASP.NET Coreで雑Webアプリを作った話
mayuki
0
660
Mujeres en SEO Summit 2026 - Greatest Disaster Hits en Web Performance
guaca
0
190
Oxcを導入して開発体験が向上した話
yug1224
4
320
Featured
See All Featured
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
201
75k
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
66
55k
AI: The stuff that nobody shows you
jnunemaker
PRO
8
720
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
400
Un-Boring Meetings
codingconduct
0
320
KATA
mclloyd
PRO
35
15k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.8k
sira's awesome portfolio website redesign presentation
elsirapls
0
280
Information Architects: The Missing Link in Design Systems
soysaucechin
0
970
BBQ
matthewcrist
89
10k
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
630
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
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]