Is it possible to put a border-radius
of a uiview
only on one side in swift
??
I have selected the circular edges that I want to remove, but I do not know how to apply a border to some sides if and not others
My code for the image is this:
imagen!.layer.cornerRadius = 7.5
imagen!.clipsToBounds = true
My code for uiview
the box:
vista!.layer.cornerRadius = 7.5
vista?.backgroundColor = AppDelegate().getColorCajas()
vista?.layer.borderColor = UIColor.grayColor().CGColor
vista?.layer.borderWidth = 1
EDITED
I added this code that is in @mhergon's response
let radius = 7.5
let pathDos = UIBezierPath(roundedRect: imagen!.bounds, byRoundingCorners: [.TopLeft, .TopRight], cornerRadii: CGSize(width: radius, height: radius))
let maskDos = CAShapeLayer()
maskDos.path = pathDos.CGPath
imagen!.layer.mask = maskDos
But the images appear to me now cut, and the edge keeps coming out on the right side