
Это похоже на то, как обрезается RoundedRectangle пополам.
Мой текущий код:
struct LeadingClipper: Shape {
let leading: CGFloat
func path(in rect: CGRect) -> Path {
RoundedRectangle(cornerRadius: 25, style: .continuous).path(in: CGRect(x: rect.size.width - leading,y: 0 , width: rect.size.width, height: leading))
}
}
Подробнее здесь: https://stackoverflow.com/questions/686 ... lf-swiftui
Мобильная версия