Member-only story
Create a SwiftUI Clock That Counts Down to WWDC 2022
Draw the Apple logo as a SwiftUI shape and display the time remaining underneath

First I’m going to recreate the Apple logo as a SwiftUI path. To make it easy to draw the path I’ve created an object that automatically creates all of the necessary points.
It is created by passing the maxX
and maxY
values of the frame it is being drawn in, as all of the points are drawn in relation to those maximum values.
These points were chosen as estimates by me, so you may disagree about how the overall shape turns out.
If you want to move any points in the shape you can do that here, making sure to multiply by maxX
or maxY
to get a relative position rather than a hard-coded one. The shape can be any size, so a fixed position would potentially be outside of the frame and would not scale.
Multiplying by the max in either direction makes a value of 1 equal to that maximum.