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:
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?
Xcode now shows IB build errors if you click on the "Show Report Navigator" then look at the Interface Build section.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With