Created
March 10, 2016 09:20
-
-
Save ltebean/60cba7f13108620309a2 to your computer and use it in GitHub Desktop.
Xib based view
This file contains hidden or 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
- (id)initWithFrame:(CGRect)frame | |
{ | |
self = [super initWithFrame:frame]; | |
if (self) { | |
[self load]; | |
} | |
return self; | |
} | |
- (id)initWithCoder:(NSCoder *)aDecoder | |
{ | |
self = [super initWithCoder:aDecoder]; | |
if (self) { | |
[self load]; | |
} | |
return self; | |
} | |
- (void)load | |
{ | |
self.backgroundColor = [UIColor clearColor]; | |
UIView *view = [[[NSBundle bundleForClass:[self class]] loadNibNamed:@"CommentView" owner:self options:nil] lastObject]; | |
view.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; | |
view.frame = self.bounds; | |
[self addSubview: view]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment