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; …