Spiral is a SwiftUI shape for macOS, iOS and watchOS.
A spiral is a component that includes a point generator, Shape and View of the spiral. The point generator allows direct data to be used for particularly rare cases. The Shape and View of the spiral is designed for SwiftUI. The Spiral shape can be outlined or filled with the desired material. The `SpiralView’ allows you to place arbitrary views at spiral points.
Spiral
is a SwiftUI shape for macOS, iOS and watchOS.A spiral is a component that includes a point generator,
Shape
andView
of the spiral. The point generator allows direct data to be used for particularly rare cases. TheShape
andView
of the spiral is designed for SwiftUI. TheSpiral
shape can be outlined or filled with the desired material. The `SpiralView’ allows you to place arbitrary views at spiral points.Requirements
Some of the requirements could be reduced if there is a demand for them.
Installation
File
⟩Add Packages...
Add Package
Add Package
Preview
https://user-images.githubusercontent.com/284922/168488964-d07c9434-6e3c-4738-8a5a-b34c2b6c0122.mov
https://user-images.githubusercontent.com/284922/168489048-ab6fd895-c26b-499e-aa3e-c6368e1e2fd2.mov
Usage Example
Usage
Spiral Shape
It has several parameters:
pathType
: the type of path you want to draw.startAt
: the start angle of a spiral.endAt
: the end angle of a spiral.smoothness
: the point density which describes a spiral.offsetRadius
: spiral radius offset for each point with respect to the calculated angle and frame.offsetAngle
: angle offset of each spiral point with respect to the calculated angle and frame.Spiral View
When using
SpiralView
, you need to position the content based on the spiral point coordinates.Documentation
You can find the generated DocC documentation here.
Demo App
You can play with all the parameters in the demo app, which can be run on macOS, iPad, iPhone.
The app heavily uses the
CompactSlider
, which you can find out more about here.Support
You can buy me a coffee here ☕️
License
Spiral
is available under the MIT license