I'd like to create a UIView that has rounded corners on the top left and top right.
In order to do that, i'd like to mask the UIView with a CAShapeLayer.
This is the code I am using:
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:self.menuContainerView.bounds
byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight
cornerRadii:CGSizeMake(20.0, 20.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame = self.menuContainerView.bounds;
maskLayer.path = maskPath.CGPath;
self.menuContainerView.layer.mask = maskLayer;
however, when i run this code, it appears that the mask has no effect. Any ideas why not?