0Pricing
Swift Academy · Lesson

Transforms and 3D Effects

Apply affine and 3D transforms.

Transforms Move and Distort

A transform reshapes a layer—translate, scale, rotate, skew—without changing its bounds. Core Animation supports both 2D (CGAffineTransform) and 3D (CATransform3D).

2D Affine Transforms

CGAffineTransform handles flat transforms. Combine them by concatenation; order matters.

import UIKit
var t = CGAffineTransform.identity
t = t.scaledBy(x: 1.5, y: 1.5)
t = t.rotated(by: .pi / 6)
layer.setAffineTransform(t)

All lessons in this course

  1. CALayer Fundamentals
  2. Implicit and Explicit Animations
  3. Transforms and 3D Effects
  4. Custom Drawing with Core Graphics
← Back to Swift Academy