I have the following files:
- ViewController.xib
- ViewController.h
- ViewController.m
- BannerView.xib
- BannerView.h (inherits from UIView)
- BannerView.m
My view controller is connected up and is working fine. I created BannerView and performed necessary linking as described in this tutorial: http://www.maytro.com/2014/04/27/building-reusable-views-with-interface-builder-and-auto-layout.html
However, in my ViewController.xib when I add a UIView and set it's class to the BannerView it just doesn't load. The app doesn't crash or anything.
Have I missed any steps, any help would be appreciated.
EDIT 1 - Added images and code
BannerView.h
@property (nonatomic, strong) IBOutlet UIView *view;
#import "BannerView.h"
@implementation BannerView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
if(self) {
[self setup];
}
return self;
}
- (void)setup {
[[NSBundle mainBundle] loadNibNamed:@"BannerView" owner:self options:nil];
[self addSubview:self.view];
}
@end
Banner View XIB - Files Owner
Banner View - View