Created
August 24, 2011 20:59
-
-
Save matthusby/1169217 to your computer and use it in GitHub Desktop.
MyView.j
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation MyView : CPView | |
{ | |
CALayer _rootLayer; | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ | |
self = [super initWithFrame:aFrame]; | |
if (self) | |
{ | |
[self setWantsLayer:YES]; | |
_rootLayer = [CALayer layer]; | |
[self setLayer:_rootLayer]; | |
[_rootLayer setBackgroundColor:[CPColor darkGrayColor]]; | |
[_rootLayer setNeedsDisplay]; | |
} | |
return self; | |
} | |
@end | |
@implementation MyView2 : CPView | |
{ | |
} | |
- (id)initWithFrame:(CGRect)aFrame | |
{ | |
self = [super initWithFrame:aFrame]; | |
if (self) | |
{ | |
[self setBackgroundColor:[CPColor blueColor]]; | |
} | |
return self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment