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
Tranformations - Core Animation
Search
Jasdev Singh
March 22, 2016
Technology
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Tranformations - Core Animation
Chapter review from Nick Lockwood's Core Animation book at Tumblr's iOS Book Club
Jasdev Singh
March 22, 2016
More Decks by Jasdev Singh
See All by Jasdev Singh
Tuning for Speed
jasdev
0
96
Hidden Gems in Swift
jasdev
6
1.4k
Swift 2.2 & 3.0 Changes
jasdev
1
720
Profiling
jasdev
0
86
Accessing Data
jasdev
0
110
Lessons in Building APIs
jasdev
0
140
UVA ACM Interview Tips
jasdev
0
120
Other Decks in Technology
See All in Technology
C#未経験の僕がAIに読めるコードを書かせるまで
maguroalternative
0
250
AIエージェントの自己改善をどう設計するか / How to Design Self-Improvement for AI Agents
22mi
26
17k
Issue 駆動でスペシャリストの意図を届ける、AI 実装のアクセシビリティ向上
thkt
0
140
サーバーレスをどこまで使う? WebRTC対戦ゲームで選んだVPSとの共存設計
kaidouji85
0
370
エージェントはローカル、検証はMicroVM — Lambda MicroVMsでつくるServerless CI
fujioka6789
3
730
2026_devsumi_ozono.pdf
o3
3
590
C#コードの結合を可視化する Roslyn解析による設計改善と リファクタリング判断
dora56
0
510
時うどん〜Socket.getifaddrsで学ぶネットワーク編 / Tokiudon: The Socket.getifaddrs Edition
coe401_
4
230
絵ではじめるKubernetesセキュリティ
aoi1
5
700
AIによるクリエイティブ生成を行う上での試行錯誤
plaidtech
PRO
0
180
AIに賢く動いてもらうためのコンテキスト〜Snowflake女子会 vol.8
snowwmn0824
0
160
2026-09-08 そのJavaモダナイゼーション、AIに丸投げで大丈夫?IBM Bobで変わる品質と効率
yutanonaka
1
160
Featured
See All Featured
Building AI with AI
inesmontani
PRO
1
1.2k
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Marketing to machines
jonoalderson
1
5.8k
Docker and Python
trallard
47
4.2k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
8k
Practical Orchestrator
shlominoach
192
12k
A better future with KSS
kneath
240
18k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Unsuck your backbone
ammeep
672
58k
We Are The Robots
honzajavorek
0
380
For a Future-Friendly Web
brad_frost
183
10k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
560
Transcript
TRANSFORMATIONS IOS BOOK CLUB JASDEV SINGH
AFFINE TRANSFORMATIONS > Rotation > CGAffineTransformMakeRotation(_:) > Scaling > CGAffineTransformMakeScale(_:_:)
> Translations > CGAffineTransformMakeTranslation(_:_:)
UIView transform PROPERTY Really just a wrapper on the underlying
CALayer feature, affineTransform.
COMPOSING TRANSFORMATIONS Core Graphics provides functions that take existing transformations
and applies another on top of it. > CGAffineTransformRotate(_:_:) > CGAffineTransformScale(_:_:_:) > CGAffineTransformTranslate(_:_:_:) > CGAffineTransformConcat(_:_:)
SAMPLE TRANSFORMATION > 50% scale > Rotate 30 degrees >
Vertical translation by 200 points public func +(lhs: CGAffineTransform, rhs: CGAffineTransform) -> CGAffineTransform { return CGAffineTransformConcat(lhs, rhs) }
import UIKit class ViewController: UIViewController { let view1 = UIView()
override func viewDidLoad() { super.viewDidLoad() view1.backgroundColor = .greenColor() view1.frame = CGRect(origin: view.center, size: CGSize(width: 150, height: 150)) view.addSubview(view1) let transform = CGAffineTransformIdentity + CGAffineTransformMakeScale(0.5, 0.5) + CGAffineTransformMakeRotation(CGFloat(M_PI) / 180 * 30) + CGAffineTransformMakeTranslation(0, 200) view1.layer.setAffineTransform(transform) } }
None
ARTISANAL TRANSFORMATIONS If you need to to make custom affine
transformations that aren't built into Core Graphics, you can directly set values on the transformation matrix:
3D TRANSFORMS The transform property on CALayer is of type
CATransform3D. > CATransform3DMakeRotation(_:_:_:_:) > CATransform3DMakeScale(_:_:_:) > CATransform3DMakeTranslation(_:_:_:)
Perspective Projections By default, Core Animation uses isometric projections, which
preserves parallel lines in 3D space. To give our 3D transformations a sense of depth, we have to add a perspective transform .
By default, . To apply perspective, set to , where
is the distance between the imaginary camera and the screen, in points. usually works well.
sublayerTransform PROPERTY A CATranmsform3D property on CALayer that allows you
to apply a transform to all sublayers!
doubleSided PROPERTY