#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