Triangle
is a small package for drawing basic triangles in SwiftUI
.
Triangles can be drawn with automatically evenly-distributed lines and angles, or with specific angles set. Alternatively, they can be drawn with the upper vertex a relative distance across the top edge of the frame.
All triangles are drawn right-side up, with 1 side flat on the bottom of the frame. This is to eliminate any extra coordinate-based complications. If you need to manipulate them in a more complex way, all of SwiftUI
's View
, Shape
, and InsettableShape
modifiers are at your disposal to scale, rotate, move, and more.