Many shapes and patterns can be created using Path and Canvas in SwiftUI. It would be
great to be able to save these as images in the Photo Library. This is possible using
UIKit, by first converting the SwiftUI View to UIImage and then saving this image to
It is said that use of Canvas to create complex shapes can provide better performance
in SwiftUI. This article compares performance of scrolling through multiple instances
of the same card pattern created using shape, canvas or image.
Create an interactive star rating SwiftUI component. This article will use the star
cutout shape with rounded corners as well as elements of the custom slider to create
a star rating component in SwiftUI.
The Star shape used in the Star cutout has sharp corners. This article shows how to
modify the shape to create stars with rounded corners. The radius of the corner can
be set as a parameter to specify the rounding of the outer and inner corners of the star.
Path can be used in SwiftUI to create practically any shape. I found creating a
cutout shape difficult until I found that FillStyle can be used with the even-odd
rule. This article shows how to create a shape outline where the outside can be
colored and the center kept transparent to allow other content to show …