Created
October 7, 2013 03:32
-
-
Save zengyun-hacker/6862167 to your computer and use it in GitHub Desktop.
draw line
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)drawRect:(CGRect)rect { | |
[super drawRect:rect]; | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetStrokeColorWithColor(context, [UIColor redColor].CGColor); | |
// Draw them with a 2.0 stroke width so they are a bit more visible. | |
CGContextSetLineWidth(context, 2.0); | |
CGContextMoveToPoint(context, 0,0); //start at this point | |
CGContextAddLineToPoint(context, 20, 20); //draw to this point | |
// and now draw the Path! | |
CGContextStrokePath(context); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment