-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBIGDrawView.m
48 lines (39 loc) · 884 Bytes
/
BIGDrawView.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
41
42
43
44
45
46
47
48
//
// BIGDrawView.m
// InstantGramification
//
// Created by Justin Warmkessel on 3/21/13.
// Copyright (c) 2013 Justin Warmkessel. All rights reserved.
//
#import "BIGDrawView.h"
@implementation BIGDrawView
@synthesize drawBlock = _drawBlock;
- (void)dealloc
{
[self.drawBlock release], self.drawBlock = nil;
[super dealloc];
}
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect
{
[super drawRect:rect];
CGContextRef context = UIGraphicsGetCurrentContext();
if(self.drawBlock)
self.drawBlock(self,context);
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end