Morphi

master

Shapes for SwiftUI ♡☾
phimage/morphi

Morphi - Μορφ

License Platform Language Build Status Sponsor Become a Patron! Buy me a coffee

Morphi provides some additional shapes for SwiftUI.

Screen shot

  • Triangle
  • Parallelogram(topLeftAngle)
  • Polygon(sides)
  • RoundedPolygon(sides, cornerRadius)
  • Heart
  • Moon(angle)
  • PlusSign(width)
  • Star(points)
  • Wave(isUp, width, offset)
  • SuperEllipse(n)
  • Drop
  • Ring(radius) (to use with a FillStyle with eoFill equal to true)
  • Gear(radius, cogs) (to use with a FillStyle with eoFill equal to true)

Examples

Create a shape view

Like any other shapes just initialize it.

 Heart().fill(Color.red).frame(width: 100, height: 100)

Heart

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)

PolygonDrop

UIKit

For UIKit version with UIBezierPath see IBAnimatable framework

Description

  • Swift Tools 5.1.0
View More Packages from this Author

Dependencies

  • None
Last updated: Mon Nov 11 2024 04:49:27 GMT-1000 (Hawaii-Aleutian Standard Time)