-
-
Notifications
You must be signed in to change notification settings - Fork 416
Round Specific Corners
Vatsal Manot edited this page Jul 7, 2020
·
1 revision
SwiftUI currently does not provide a way to round specific corners of a view. SwiftUIX offers a solution for this:
public struct PartlyRoundedRectangle: Shape {
public let corners: [RectangleCorner]
public let cornerRadii: CGFloat
public init(corners: [RectangleCorner], cornerRadii: CGFloat)
}
Usage:
struct Foo: View {
var body: some View {
PartlyRoundedRectangle(
corners: [.topLeading, .topTrailing],
cornerRadii: 13
)
.fill(Color.red)
}
}
If you see any problems with the content above, please file an issue here.