0Pricing
Swift Academy · Lesson

TimelineView and Canvas for High-Performance Drawing

Rendering real-time animations with TimelineView schedules and Canvas API.

TimelineView Overview

TimelineView redraws its content on a schedule, enabling real-time animations without timers.

TimelineView(.animation) { timeline in
  Text(timeline.date.formatted(date: .omitted, time: .standard))
}

TimelineSchedule Types

Built-in schedules: .animation (every frame), .periodic (fixed interval), .explicit (specific dates).

TimelineView(.periodic(from: .now, by: 1.0)) { context in
  ClockFace(date: context.date)
}

All lessons in this course

  1. Implicit vs Explicit Animations
  2. matchedGeometryEffect for Hero Transitions
  3. Custom AnimatableModifier and Animatable
  4. TimelineView and Canvas for High-Performance Drawing
← Back to Swift Academy