#import "LayerDemoViewController.h"

@implementation LayerDemoViewController
@synthesize imageLayer;

-(CALayer *) imageLayer {
    if (nil == imageLayer) {
        self.imageLayer = [CALayer layer];
        imageLayer.contents =
                   (id)( [UIImage imageNamed:@"devday.png"].CGImage);
        imageLayer.position = CGPointMake(self.view.bounds.size.width/2, 
                                          self.view.bounds.size.height/2);
        imageLayer.bounds = CGRectMake(0.0, 0.0, 400.0,200.0);
    }
    return imageLayer;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    [self.view.layer addSublayer:self.imageLayer];
}


// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

- (void)didReceiveMemoryWarning {
	// Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
	
	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}


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

@end
