+(void)drawRoundRectInContext:(CGContextRef)context withRect:(CGRect)rect{
CGFloat minx = CGRectGetMinX(rect);
CGFloat midx = CGRectGetMidX(rect);
CGFloat maxx = CGRectGetMaxX(rect);
CGFloat miny = CGRectGetMinY(rect);
CGFloat midy = CGRectGetMidY(rect);
CGFloat maxy = CGRectGetMaxY(rect);
CGFloat filletRadius = CGRectGetHeight(rect)/2;
CGContextMoveToPoint(context, minx, midy);
CGContextAddArcToPoint(context, minx, miny, midx, miny, filletRadius);
CGContextAddArcToPoint(context, maxx, miny, maxx, midy, filletRadius);
CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, filletRadius);
CGContextAddArcToPoint(context, minx, maxy, minx, midy, filletRadius);
//CGContextFillPath(context);
//CGContextDrawPath(context, kCGPathFillStroke);
CGContextClosePath(context);
CGContextSaveGState(context);
}
CGRect drawRect = {30,30,100,100};
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 1.5);
CGContextSetStrokeColorWithColor(context, [UIColor greenColor].CGColor);
UIBezierPath *bezierPath = [UIBezierPath bezierPathWithRoundedRect:drawRect cornerRadius:10];
CGContextAddPath(context, bezierPath.CGPath);
CGContextStrokePath(context);