blob: c4f41b57ef0bae252f87ddb0efb7a33390f1219a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#import "Ball.h"
@implementation Ball
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
- (void)drawRect:(CGRect)rect
{
CGContextRef context = UIGraphicsGetCurrentContext();
CGContextAddEllipseInRect(context, CGRectMake(5, 5, 65, 65));
[[UIColor whiteColor] setStroke];
CGContextSetLineWidth(context, 5);
[[UIColor greenColor] setFill];
CGContextDrawPath(context, kCGPathFillStroke);
}
@end
|