Answers for "add top corner radius swift"

3

add top corner radius swift

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
    }
}
Posted by: Guest on July-10-2020
0

add top corner radius swift

let view = UIView()
view.layer.cornerRadius = 10

@available(iOS 11.0, *)
view.layer.maskedCorners = [.layerMinXMinYCorner, .layerMaxXMinYCorner]
Posted by: Guest on May-17-2021

Code answers related to "add top corner radius swift"

Code answers related to "Swift"

Browse Popular Code Answers by Language