
UIView *myView=[[UIView alloc]initWithFrame:CGRectMake(50, 70, 200, 200)];
UIBezierPath * bezierPath = [UIBezierPath bezierPathWithRoundedRect:myView.bounds byRoundingCorners:UIRectCornerBottomLeft |UIRectCornerBottomRight cornerRadii:CGSizeMake(5, 5)];
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = myView.bounds;
maskLayer.path = bezierPath.CGPath;
myView.layer.mask = maskLayer;
myView.backgroundColor=[UIColor redColor];
[self.view addSubview:myView];