Created
January 24, 2021 13:25
-
-
Save prafullakumar/368de7e87388c9cf9816af9638438bdc 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
//step 1 -- Create a shape view which can give shape | |
struct CornerRadiusShape: Shape { | |
var radius = CGFloat.infinity | |
var corners = UIRectCorner.allCorners | |
func path(in rect: CGRect) -> Path { | |
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) | |
return Path(path.cgPath) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment