Is there a way to set cornerRadius
for only top-left and top-right corner of a UIView
?
I tried the following, but it end up not seeing the
Swift code example here: https://stackoverflow.com/a/35621736/308315
Not directly. You will have to:
CAShapeLayer
path
to be a CGPathRef
based on view.bounds
but with only two rounded corners (probably by using +[UIBezierPath bezierPathWithRoundedRect:byRoundingCorners:cornerRadii:])view.layer.mask
to be the CAShapeLayer