Recenlty I've made reusable class for rendering IBDesignables
xibs in interface view.
@interface ReusableView ()
@property (nonatomic, strong) UIView *contentView;
@end
@implementation ReusableView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
[self setupXib];
return self;
}
- (instancetype)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithCoder:aDecoder];
[self setupXib];
return self;
}
- (void)setupXib {
self.contentView = [self loadFromNib];
self.contentView.frame = self.bounds;
self.contentView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self addSubview:self.contentView];
}
- (UIView *)loadFromNib {
NSBundle *bundle = [NSBundle bundleForClass: [self class]];
UINib *nib = [UINib nibWithNibName:NSStringFromClass([self class]) bundle:bundle];
UIView *view = (UIView *)[[nib instantiateWithOwner:self options:nil] firstObject];
return view;
}
@end
So far everything was ok until today. I've changed literally nothing in my code (I've even rolled-back to master branch to be sure) and my xibs using this class are no longer rendering in storyboards.
In interface builder there is information
Designables: Build failed
but the show button does nothing, as well as trying to use Editor > Debug Selected Views. I am unable to hit any breakpoint in my class.
So far I tried:
- cleaning derived-data
- restarting x-code
- killing Interface Builder Cocoa Touch Tool
- full-restart
- project clean (in between previously described actions)
Is it some kind of xcode bug or somehow it's my fault? Is it possible to debug Designables any other way than with Debug Selected Views
option?