Skip to content

Instantly share code, notes, and snippets.

@harukizaemon
Created March 30, 2012 12:09
Show Gist options
  • Save harukizaemon/2251098 to your computer and use it in GitHub Desktop.
Save harukizaemon/2251098 to your computer and use it in GitHub Desktop.
Load a custom view from a XIB
- (id)initWithCoder:(NSCoder *)coder {
self = [super initWithCoder:coder];
if (self) {
[self addSubview:[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] objectAtIndex:0]];
}
return self;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment