morphi
morphi copied to clipboard
Shapes for SwiftUI ♡☾
Morphi - Μορφ
Morphi provides some additional shapes for SwiftUI.
- [x]
Triangle - [x]
Parallelogram(topLeftAngle) - [x]
Polygon(sides) - [x]
RoundedPolygon(sides, cornerRadius) - [x]
Heart - [x]
Moon(angle) - [x]
PlusSign(width) - [x]
Star(points) - [x]
Wave(isUp, width, offset) - [x]
SuperEllipse(n) - [x]
Drop - [x]
Ring(radius)(to use with aFillStylewitheoFillequal totrue) - [x]
Gear(radius, cogs)(to use with aFillStylewitheoFillequal totrue)
Examples
Create a shape view
Like any other shapes just initialize it.
Heart().fill(Color.red).frame(width: 100, height: 100)
Mask an existing view
aView.clipShape(Drop())
// or using static member
aView.clipShape(.drop)
You can even do it on another shape.
Polygon(sides: 6).fill(Color.red).clipShape(.drop)
UIKit
For UIKit version with UIBezierPath see IBAnimatable framework