[iOS] Draw Dashed Border Around View
+ (void)drawDashedBorderAroundView:(UIView *)v cornerRadius:(CGFloat)cornerRadius borderWidth:(CGFloat)borderWidth dashPattern1:(NSInteger)dashPattern1 dashPattern2:(NSInteger)dashPattern2 lineColor:(UIColor*)lineColor { //border definitions // CGFloat cornerRadius = 10; // CGFloat borderWidth = 2; // NSInteger dashPattern1 = 4; // NSInteger dashPattern2 = 8; // UIColor *lineColor = [UIColor grayColor]; CGRect newR = v.frame; newR.origin.x += borderWidth/2; newR.origin.y += borderWidth/2; newR.size.width -= borderWidth; newR.size.height -= borderWidth; v.frame = newR; //drawing CGRect frame = v.bounds; CAShapeLayer *_shapeLayer = [CAShapeLayer layer]; //creating a path CGMutablePathRef path = CGPathCreateMutable(); //drawing a border around a view CGPathMoveToPoint(path, NULL, 0, frame.size.height -...