Drawing a Shape with Paths and Arcs in SwiftUI | lukecsmith.co.uk
Ive just been spending a bit longer than should be necessary, creating a shape for the app Im working on currently. So I thought I'd share and clarify a few things for myself and anyone else. The shape looks like this: Having started doing graphics coding with BBC Basic in the 80s, my brain has various different coordinate spaces in it (for eg .. 0,0 used to be bottom left of the screen in those days). So for clarity, the SwiftUI coordinate space works like this: (0, 0) in SwiftUI is the top left of the screen. Positive increases in values for x and y move the position to the right, and downwards, respectively. To create the path and fill it for the shape above, first I need a Shape object: Notice that the path function above has a CGRect parameter. The size of that CGRect doesnt really matter - that is something that SwiftUI will decide when presenting the shape. For example, I could present the shape with a fixed frame, to set the width and height parameters of that CGRect. I could j
Ive just been spending a bit longer than should be necessary, creating a shape for the app Im working on currently. So I thought I'd share and clarify a few things for myself and anyone else. The shape looks like this: Having started doing graphics coding with BBC Basic in the 80s, my brain has various different coordinate spaces in it (for eg .. 0,0 used to be bottom left of the screen in those days). So for clarity, the SwiftUI coordinate space works like this: (0, 0) in SwiftUI is the top left of the screen. Positive increases in values for x and y move the position to the right, and downwa
Explore this link on the map →