CGRect rect =CGRectMake(50,50, 100,100);
CGSize radii = CGSizeMake(20,20);
UIRectCorner corners = UIRectCornerTopRight |UIRectCornerBottomRight | UIRectCornerBottomLeft;
UIBezierPath *path = [UIBezierPathbezierPathWithRoundedRect:rect byRoundingCorners:corners cornerRadii:radii];
CAShapeLayer *layer = [CAShapeLayerlayer];
layer.strokeColor = [UIColorredColor].CGColor;
layer.lineWidth =5;
layer.lineJoin =kCALineJoinRound;
layer.lineCap =kCALineCapRound;
layer.fillColor = [UIColorblueColor].CGColor;
layer.path = path.CGPath;
[self.view.layeraddSublayer:layer];