Skip to content

Instantly share code, notes, and snippets.

@sebastienwindal
Created December 12, 2012 14:23
Show Gist options
  • Save sebastienwindal/4268084 to your computer and use it in GitHub Desktop.
Save sebastienwindal/4268084 to your computer and use it in GitHub Desktop.
@implementation MyView2
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
// Initialization code
}
return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
@implementation MyView
- (id)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self commonInitialiation];
}
return self;
}
-(id) initWithCoder:(NSCoder *)aDecoder
{
self = [super initWithCoder:aDecoder];
if (self) {
[self commonInitialiation];
}
return self;
}
-(void) commonInitialiation
{
// common initialization
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
*/
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment