My IBImageView is like this:
In LMLCommonIBImageView.h
:
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface LMLCommonIBImageView : UIImageView
@property (nonatomic, assign)IBInspectable CGFloat borderWidth;
@property (nonatomic, strong)IBInspectable UIColor *borderColor;
@property (nonatomic, assign)IBInspectable CGFloat cornerRadius;
@end
In LMLCommonIBImageView.m
file:
#import "LMLCommonIBImageView.h"
@implementation LMLCommonIBImageView
- (void)setBorderWidth:(CGFloat)borderWidth {
if (borderWidth < 0) return;
self.layer.borderWidth = borderWidth;
}
- (void)setBorderColor:(UIColor *)borderColor {
self.layer.borderColor = borderColor.CGColor;
}
- (void)setCornerRadius:(CGFloat)cornerRadius {
self.layer.cornerRadius = cornerRadius;
self.layer.masksToBounds = cornerRadius > 0;
}
I get this error:
IBDesignables Build failed