11
IB_DESIGNABLE,IBInspectable-接口构建器不会更新
我有以下代码集: CustomView.h #import <UIKit/UIKit.h> IB_DESIGNABLE @interface CustomView : UIView @property (nonatomic) IBInspectable UIColor *borderColor; @property (nonatomic) IBInspectable CGFloat borderWidth; @property (nonatomic) IBInspectable CGFloat cornerRadius; @end CustomView.m #import "CustomView.h" @implementation CustomView - (void)setBorderColor:(UIColor *)borderColor { _borderColor = borderColor; self.layer.borderColor = borderColor.CGColor; } - (void)setBorderWidth:(CGFloat)borderWidth { _borderWidth = borderWidth; self.layer.borderWidth = borderWidth; …