Created
June 16, 2020 15:51
-
-
Save prafullakumar/3bf1effc2bf770bf27025330e793397a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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