UIBezierPath *topmaskPath = [UIBezierPath bezierPathWithRoundedRect:topView.bounds byRoundingCorners:UIRectCornerTopLeft | UIRectCornerTopRight cornerRadii:CGSizeMake(10, 10)];
CAShapeLayer *topmaskLayer = [[CAShapeLayer alloc] init];
topmaskLayer.frame = topView.bounds;
topmaskLayer.path = topmaskPath.CGPath;
topView.layer.mask = topmaskLayer;