0Pricing
Swift Academy · Lesson

CALayer Fundamentals

Work with layers, their properties, and hierarchy.

What Is a CALayer?

CALayer is the backing store for everything you see in UIKit. Each UIView is drawn by a layer that holds its visual content as a texture on the GPU.

Working with layers directly unlocks hardware-accelerated graphics and animation.

import UIKit
let layer = CALayer()

Layers Behind Views

Every view has a layer property. Setting layer properties is often simpler and cheaper than custom drawing.

view.layer.cornerRadius = 12
view.layer.masksToBounds = true

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