SwiftUI Arc
Reading time: 1 min
Here's a simple recipe to help you draw Arc shapes in SwiftUI. For some reason, arcs still aren't a part of the standard Shape
package, but fortunately, wrapping them isn't too difficult.
Stroke and fill a Shape in SwiftUI
Reading time: 1 min
For whatever reason, stroking (i.e drawing a border) and filling a SwiftUI Shape
at the same time is difficult and unintuitive. Shape
has methods for both, stroke
and fill
, respectively, but they both return some View
, meaning you can't chain them.
Freeform Drawing in SwiftUI
Reading time: 2 min
This recipe shows how to let your users draw with mouse/finger in SwiftUI.