Skip to content

Instantly share code, notes, and snippets.

@dlinsin
Created June 28, 2010 10:16
Show Gist options
  • Save dlinsin/455669 to your computer and use it in GitHub Desktop.
Save dlinsin/455669 to your computer and use it in GitHub Desktop.
- (id)initWithParent:(UIView *)parent {
self = [self initWithFrame:CGRectZero];
if (!self)
return nil;
[parent addSubview:self];
return self;
}
+ (id) viewWithParent:(UIView *)parent {
return [[[self alloc] initWithParent:parent] autorelease];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment