Skip to content

Instantly share code, notes, and snippets.

@prafullakumar
Created June 16, 2020 15:51
Show Gist options
  • Save prafullakumar/3bf1effc2bf770bf27025330e793397a to your computer and use it in GitHub Desktop.
Save prafullakumar/3bf1effc2bf770bf27025330e793397a to your computer and use it in GitHub Desktop.
import SwiftUI
struct Spade: Shape {
func path(in rect: CGRect) -> Path {
let (x, y, width, height) = rect.centeredSquare.flatten()
var heartPath = Heart().rotation(.A180).path(in: CGRect(x: x, y: y, width: width, height: height * 0.9)) //take 10% for bottom rect
let rectPath = Rectangle().path(in: CGRect(x: x + width * 0.4, y: y + height * 0.5, width: width * 0.2, height: height * 0.5))
heartPath.addPath(rectPath)
return heartPath
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment