//
//  FillingView.m
//  FillingSquare
//
//  Created by Bill Dudney on 12/10/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//
//
//  Licensed with the Apache 2.0 License
//  http://apache.org/licenses/LICENSE-2.0
//

#import "FillingView.h"


@implementation FillingView


- (id)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        // Initialization code
    }
    return self;
}


//START:code.fillingview.square.drawRect:
- (void)drawRect:(CGRect)rect {
  CGMutablePathRef path = CGPathCreateMutable();
  CGPathMoveToPoint(path, NULL, 10.0f, 10.0f);
  CGPathAddLineToPoint(path, NULL, 100.0f, 10.0f);
  CGPathAddLineToPoint(path, NULL, 100.0f, 100.0f);
  CGPathAddLineToPoint(path, NULL, 10.0f, 100.0f);
  CGPathCloseSubpath(path);
  CGContextRef ctx = UIGraphicsGetCurrentContext();
  CGContextSetFillColorWithColor(ctx, [UIColor blueColor].CGColor);
  CGContextAddPath(ctx, path);
  CGContextFillPath(ctx);
}
//END:code.fillingview.square.drawRect:


- (void)dealloc {
    [super dealloc];
}


@end
