Skip to content

Instantly share code, notes, and snippets.

@srgtuszy
Created January 16, 2012 16:36
Show Gist options
  • Save srgtuszy/1621679 to your computer and use it in GitHub Desktop.
Save srgtuszy/1621679 to your computer and use it in GitHub Desktop.
+(UIView *)fetchViewFromNib:(NSString *)nibName withClass:(Class)viewClass {
NSArray *nibObjects = [[NSBundle mainBundle] loadNibNamed:nibName owner:nil options:nil];
UIView *view = nil;
for (id object in nibObjects) {
if ([object isKindOfClass:viewClass]) {
view = object;
}
}
return view;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment