当我将图像设置为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构建失败

在此处输入图像描述

尝试这个

  1. 干净的项目。
  2. 然后在storyboard中进入Editor菜单并刷新所有视图; 等待构建完成。