当我将图像设置为IBImageView时,生成失败
我的IBImageView是这样的:
在LMLCommonIBImageView.h
:
#import IB_DESIGNABLE @interface LMLCommonIBImageView : UIImageView @property (nonatomic, assign)IBInspectable CGFloat borderWidth; @property (nonatomic, strong)IBInspectable UIColor *borderColor; @property (nonatomic, assign)IBInspectable CGFloat cornerRadius; @end
在LMLCommonIBImageView.m
文件中:
#import "LMLCommonIBImageView.h" @implementation LMLCommonIBImageView - (void)setBorderWidth:(CGFloat)borderWidth { if (borderWidth 0; }
我收到此错误:
IBDesignables构建失败
尝试这个
- 干净的项目。
- 然后在storyboard中进入Editor菜单并刷新所有视图; 等待构建完成。