Follow along at https://www.hackingwithswift.com/100/swiftui/43.
This day covers Part One of Project 9: Drawing
in the 100 Days of SwiftUI Challenge.
It focuses on several specific topics:
- Drawing: Introduction
- Creating custom paths with SwiftUI
- Paths vs shapes in SwiftUI
- Adding strokeBorder() support with InsettableShape
From the description:
In this technique project we’re going to take a close look at drawing in SwiftUI, including creating custom paths and shapes, animating your changes, solving performance problems, and more>
For custom paths, the StrokeStyle
constructor is one of your best friends. This gives us fine-grained
control over many of the imporant properties that define path style:
public struct StrokeStyle : Equatable {
public var lineWidth: CGFloat
public var lineCap: CGLineCap
public var lineJoin: CGLineJoin
public var miterLimit: CGFloat
public var dash: [CGFloat]
public var dashPhase: CGFloat
...
}