-
Notifications
You must be signed in to change notification settings - Fork 0
/
LineView.m
40 lines (29 loc) · 823 Bytes
/
LineView.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//
// LineView.m
// Metasome
//
// Created by Omar Metwally on 9/16/13.
// Copyright (c) 2013 Logisome. All rights reserved.
//
#import "LineView.h"
@implementation LineView
@synthesize startPoint, endPoint, initialOrigin;
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextSetLineWidth(context, 5.0);
CGContextSetLineCap(context, kCGLineCapRound);
CGContextSetRGBStrokeColor(context, 1.0, 0.0, 0.0, 0.5);
CGContextMoveToPoint(context, startPoint.x, startPoint.y);
CGContextAddLineToPoint(context, startPoint.x, startPoint.y);
CGContextStrokePath(context);
}
@end