Created
December 29, 2011 13:42
-
-
Save hollance/1534156 to your computer and use it in GitHub Desktop.
Loading view from nib
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 UIView (MHExtensions) | |
+ (id)mh_viewFromNibNamed:(NSString *)nibName owner:(id)ownerOrNil | |
{ | |
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:nibName owner:ownerOrNil options:nil]; | |
for (id object in nib) | |
{ | |
if ([object isKindOfClass:[self class]]) | |
return object; | |
} | |
return nil; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment