Hope this works. Find the top corner paths to create a mask layer
UIBezierPath *PathToMask;
PathToMask = [UIBezierPath bezierPathWithRoundedRect:self.testView.bounds
byRoundingCorners:(UIRectCornerTopLeft | UIRectCornerTopRight)
cornerRadii:CGSizeMake(8.0, 8.0)];
Create a shape layer mask using the UIBezierPath maskPath mask
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame =self.testView.bounds;
maskLayer.path = PathToMask.CGPath;
set layer mask maskLayer
self.testView.layer.mask = maskLayer;
source
share