Skip to content

Instantly share code, notes, and snippets.

@jodell
Created February 3, 2012 22:36
Show Gist options
  • Save jodell/1733401 to your computer and use it in GitHub Desktop.
Save jodell/1733401 to your computer and use it in GitHub Desktop.
2px stroke line
// Draw a 2px stroke line at the bottom of the the view.
- (void)drawRect:(CGRect)rect {
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetStrokeColorWithColor(context, [UIColor whiteColor].CGColor);
CGContextSetLineWidth(context, 2.0);
CGContextMoveToPoint(context, 0, CGRectGetMaxY(rect));
CGContextAddLineToPoint(context, CGRectGetMaxX(rect), CGRectGetMaxY(rect));
CGContextStrokePath(context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment