Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Nacho Soto's Slides at NSSpain 2013
Search
Luis Ascorbe
September 17, 2013
Programming
150
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
160
Dave Verwer's Slides at NSSpain 2014
lascorbe
0
140
Andrew Yates' Slides at NSSpain 2014
lascorbe
0
130
Alberto Lopez's Slides at NSSpain 2014
lascorbe
0
53
Erik Erice's Slides at NSSpain 2014
lascorbe
0
110
Krzysztof Zabłocki's Slides at NSSpain 2013
lascorbe
8
470
Luis Solano's Slides at NSSpain 2013
lascorbe
3
150
Daniel Eggert's Slides at NSSpain 2013
lascorbe
8
230
Other Decks in Programming
See All in Programming
Verilogで学ぶCPU自作入門.pdf
uyuki234
8
4k
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
250
Webの地図
yosuke_furukawa
PRO
6
5.1k
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
360
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.5k
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
20
21k
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
340
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
340
setup-vp GitLab対応の裏側
naokihaba
0
150
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
440
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
480
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
280
Featured
See All Featured
Making the Leap to Tech Lead
cromwellryan
135
10k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
610
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.6k
Designing Powerful Visuals for Engaging Learning
tmiket
1
590
So, you think you're a good person
axbom
PRO
2
2.2k
The SEO Collaboration Effect
kristinabergwall1
1
590
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.6k
Git: the NoSQL Database
bkeepers
PRO
433
67k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
930
Site-Speed That Sticks
csswizardry
13
1.5k
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]