I'm trying to make 2 corners of a button round. If I select .TopLeft and .BottomLeft like this:
let bezierDisableAdsPath = UIBezierPath(roundedRect: disableAdsButton.bounds, byRoundingCorners: [UIRectCorner.TopLeft , UIRectCorner.BottomLeft] , cornerRadii: CGSizeMake(4.0, 4.0))
let maskAdsLayer = CAShapeLayer()
maskAdsLayer.frame = disableAdsButton.bounds
maskAdsLayer.path = bezierDisableAdsPath.CGPath
disableAdsButton.layer.mask = maskAdsLayer
than the code works beautifully.
If I chose .TopRight and . BottomRight like this:
let bezierDisableAdsPath = UIBezierPath(roundedRect: disableAdsButton.bounds, byRoundingCorners: [UIRectCorner.TopRight , UIRectCorner.BottomRight] , cornerRadii: CGSizeMake(4.0, 4.0))
let maskAdsLayer = CAShapeLayer()
maskAdsLayer.frame = disableAdsButton.bounds
maskAdsLayer.path = bezierDisableAdsPath.CGPath
disableAdsButton.layer.mask = maskAdsLayer
than I see no round corners. What is going on here?
I already tried adding maskAdsLayer as a subview and it doesn't work.