CanvasThese are the lesson notes for this day. Its build-along tutorial and flash cards have not been written yet.
CanvasCanvas hands you a drawing context and a size, and you draw straight away — paths, text, images — without creating a view for each thing drawn. Use it when you have hundreds or thousands of items to draw, such as a chart, particles, or a waveform, where a view for each one would be too slow. Pair it with TimelineView, which redraws on a schedule, to animate.
The trade-off is that things drawn in a Canvas are not views. They have no accessibility elements, gestures, or state of their own, so you provide those for the canvas as a whole. For standard charts, use the Swift Charts framework instead.
Plot 200 data points as a line chart in a Canvas, with axis lines. Add an accessibility label that describes the chart.
Canvas over many small views?Canvas?TimelineView for?