I am having this in MyClass.h file:
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface MyClass : UIView
@end
and this is the code from the .m file:
-(void)awakeFromNib{
[super awakeFromNib];
NSLog(@"This works %lud",(unsigned long)self.max);
}
-(instancetype)initWithCoder:(NSCoder *)aDecoder{
if ((self = [super initWithCoder:aDecoder])){
NSLog(@"This doesn't work %lud",(unsigned long)self.max);
}
return self;
}
In awakeFromNib method, I get a correct value set in IB. In initWithCoder: I get this value equal to zero.
What is the appropriate time to check for a value, set in IB, for this property?
This is how I have defined a property in .m file:
@interface MyClass()
@property (nonatomic) IBInspectable NSUInteger max;
@end