Drawing in UIStackView

Hello, everyone! I am trying to draw 1,2 or 3 figures (diamonds, rectangles etc) using UIBezierPath(). Then I want to put that figure in a stackView but I don’t know how to make the figures be centered no matter how many they are because when I draw a path, I am using precent where to be positioned exactly. If anyone has an idea how to make it work, I will be very thankful!

Check this WWDC video (Building Custom Views with SwiftUI) out.
The first half talks about how SwiftUI layout things, then it talks about how to add custom alignment to your design.

1 Like