Question : add top corner radius swift
Answered by : mobile-star
extension UIView { func roundCorners(corners: UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let mask = CAShapeLayer() mask.path = path.cgPath layer.mask = mask }
}
Source : | Last Update : Fri, 17 Jul 20
Question : how to add corner in swiftui
Answered by : gleaming-goldfinch-gygbdnoqsdfy
extension UIView { func roundCorners(corners: UIRectCorner, radius: CGFloat) { let path = UIBezierPath(roundedRect: bounds, byRoundingCorners: corners, cornerRadii: CGSize(width: radius, height: radius)) let mask = CAShapeLayer() mask.path = path.cgPath layer.mask = mask }
}
Source : | Last Update : Mon, 31 May 21
Question : swiftui rounded specific corner
Answered by : charming-corncrake-zsji9rd41vzl
extension View { func cornerRadius(_ radius: CGFloat, corners: UIRectCorner) -> some View { clipShape( RoundedCorner(radius: radius, corners: corners) ) }
}
Source : https://stackoverflow.com/questions/56760335/round-specific-corners-swiftui | Last Update : Fri, 08 Jul 22
Question : swiftui rounded specific corner
Answered by : charming-corncrake-zsji9rd41vzl
struct RoundedCorner: 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) }
}
Source : https://stackoverflow.com/questions/56760335/round-specific-corners-swiftui | Last Update : Fri, 08 Jul 22