Moved around logic for drawing frame

This commit is contained in:
Kieran Lafferty
2013-08-04 15:37:32 -04:00
parent f1d7d2f532
commit 8558d2d2d8

View File

@@ -17,6 +17,7 @@
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UIViewController* center = [[UIViewController alloc] init];
[center.view setBackgroundColor: [UIColor whiteColor]];
@@ -32,19 +33,37 @@
[centerLayer setShadowPath: [[UIBezierPath
bezierPathWithRect: centerLayer.bounds] CGPath]];
UIViewController* left = [[UIViewController alloc] init];
CGRect leftFrame = left.view.frame;
leftFrame.origin.y = 10;
leftFrame.size.height -= 2 * 10;
[left.view setFrame: leftFrame];
[left.view setBackgroundColor: [UIColor whiteColor]];
CALayer* leftLayer = left.view.layer;
leftLayer.cornerRadius = 10.0;
UIViewController* right = [[UIViewController alloc] init];
CGRect rightFrame = right.view.frame;
rightFrame.origin.y = 10;
rightFrame.size.height -= 2 * 10;
[right.view setFrame: rightFrame];
[right.view setBackgroundColor: [UIColor whiteColor]];
CALayer* rightLayer = right.view.layer;
rightLayer.cornerRadius = 10.0;
UIViewController* bottom = [[UIViewController alloc] init];
[bottom.view setBackgroundColor: [UIColor purpleColor]];
CGRect bottomFrame = bottom.view.frame;
bottomFrame.origin.x = 10;
bottomFrame.size.width -= 2 * 10;
[bottom.view setFrame: bottomFrame];
[bottom.view setBackgroundColor: [UIColor lightGrayColor]];
self.circleVC = [[KLCircleViewController alloc] initWithCenterViewController: center
leftViewController: left
@@ -56,11 +75,6 @@
[self.view insertSubview: self.circleVC.view
belowSubview: self.leftButton];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (IBAction)didPressCenter:(id)sender {
[self.circleVC setState:KLCircleStateCenter