You must learn custom view with xib
and live render
first
then, add some code in your CustomView.m
we have some change at setup
method
- (void) setup{
NSString *nibName = NSStringFromClass([self class]);
//Bundle Identifier can be find at Target -> Your Framework -> Bundle Identifier
NSBundle *frameworkBundle = [NSBundle bundleWithIdentifier:@"com.yume190.CustomViewObjc"];
UINib *nib = [UINib nibWithNibName:nibName bundle:frameworkBundle];
[nib instantiateWithOwner:self options:nil];
//Add the view loaded from the nib into self.
[self addSubview:self.view];
}
Related Documents
- ViewSource.m
- CustomWithXibLiveRenderKVC.h
- CustomWithXibLiveRenderKVC.m
- and storyboard