swift中写在class 前面 @IBDesignable 注意:不是写在controller的前面,而是写在需要显示的视图的class的前面
OC中 IB_DESIGNABLE 写在@implementation前面
2.IBInspectable 属性可视
swift中写在需要显示的属性前面 @IBInspectable let height : CGFloat = 10.0f
OC中 IBInspectable @property (nonatomic, assign) height; //额 这个是错的
应该这么写
IBInspectable CGFloat x; 哈哈