CGMutablePathRef path = CGPathCreateMutable();
CGRect rect=CGRectInset(self.bounds, 10, 10);
CGFloat minx = CGRectGetMinX(rect), midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect);
CGFloat miny = CGRectGetMinY(rect), midy = CGRectGetMidY(rect), maxy = CGRectGetMaxY(rect);
CGFloat radius=10.0;
CGPathMoveToPoint(path, NULL, minx, midy);
CGPathAddArcToPoint(path, NULL, minx, miny, midx, miny, radius);
CGPathAddArcToPoint(path, NULL, maxx, miny, maxx, midy, radius);
CGPathAddArcToPoint(path, NULL, maxx, maxy, midx, maxy, radius);
CGPathAddArcToPoint(path, NULL, minx, maxy, minx, midy, radius);
CGPathCloseSubpath(path);
CGRect rect=CGRectInset(self.bounds, 10, 10);
CGFloat minx = CGRectGetMinX(rect), midx = CGRectGetMidX(rect), maxx = CGRectGetMaxX(rect);
CGFloat miny = CGRectGetMinY(rect), midy = CGRectGetMidY(rect), maxy = CGRectGetMaxY(rect);
CGFloat radius=10.0;
CGPathMoveToPoint(path, NULL, minx, midy);
CGPathAddArcToPoint(path, NULL, minx, miny, midx, miny, radius);
CGPathAddArcToPoint(path, NULL, maxx, miny, maxx, midy, radius);
CGPathAddArcToPoint(path, NULL, maxx, maxy, midx, maxy, radius);
CGPathAddArcToPoint(path, NULL, minx, maxy, minx, midy, radius);
CGPathCloseSubpath(path);