Update README.md
Morphi provides some additional shapes for SwiftUI.
Triangle
Parallelogram(topLeftAngle)
Polygon(sides)
RoundedPolygon(sides, cornerRadius)
Heart
Moon(angle)
PlusSign(width)
Star(points)
Wave(isUp, width, offset)
SuperEllipse(n)
Drop
Ring(radius)
FillStyle
eoFill
true
Gear(radius, cogs)
Like any other shapes just initialize it.
Heart().fill(Color.red).frame(width: 100, height: 100)
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)
For UIKit version with UIBezierPath see IBAnimatable framework
UIKit
UIBezierPath
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Morphi - Μορφ
Morphi provides some additional shapes for SwiftUI.
TriangleParallelogram(topLeftAngle)Polygon(sides)RoundedPolygon(sides, cornerRadius)HeartMoon(angle)PlusSign(width)Star(points)Wave(isUp, width, offset)SuperEllipse(n)DropRing(radius)(to use with aFillStylewitheoFillequal totrue)Gear(radius, cogs)(to use with aFillStylewitheoFillequal totrue)Examples
Create a shape view
Like any other shapes just initialize it.
Mask an existing view
You can even do it on another shape.
UIKit
For
UIKitversion withUIBezierPathsee IBAnimatable framework