Answers for "how to set corner radius of view in swift upper front"

2

add corner radius to uiview swift

view.layer.cornerRadius = 25
view.layer.masksToBounds = true
Posted by: Guest on April-03-2020
2

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

Code answers related to "how to set corner radius of view in swift upper front"

Code answers related to "Swift"

Browse Popular Code Answers by Language