Skip to content

Instantly share code, notes, and snippets.

@ferbass
Created October 10, 2013 01:54
Show Gist options
  • Select an option

  • Save ferbass/6911840 to your computer and use it in GitHub Desktop.

Select an option

Save ferbass/6911840 to your computer and use it in GitHub Desktop.

Revisions

  1. ferbass created this gist Oct 10, 2013.
    19 changes: 19 additions & 0 deletions gistfile1.m
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    - (void)drawRect:(CGRect)rect
    {
    CGContextRef context = UIGraphicsGetCurrentContext();

    CGContextSetStrokeColorWithColor(context, [[UIColor grayColor] CGColor]);

    CGFloat dashes[] = {1,1};

    CGContextSetLineDash(context, 0.0, dashes, 2);
    CGContextSetLineWidth(context, 1.0);

    CGContextMoveToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect));
    CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
    CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMinY(rect));
    CGContextAddLineToPoint(context, CGRectGetMinX(rect), CGRectGetMinY(rect));
    CGContextAddLineToPoint(context, CGRectGetMinX(rect), CGRectGetMaxY(rect));
    CGContextSetShouldAntialias(context, NO);
    CGContextStrokePath(context);
    }