Firstcolor and cornerradious are the new display properties are implemented in the following ways:
@property (nonatomic,weak)ibinspectable Uicolor *firstcolor;
/...................................../
-(void) Setfirstcolor: (Uicolor *) firstcolor{
_firstcolor = Firstcolor;
Self.backgroundcolor = Firstcolor;
}
Add the Ibinspectable keyword before the defined property (the view has been dragged onto the controller)
You can create a new category for a view if you want all of the view's properties to be displayed on IB
@interface UIView (ibispectable)
@property (nonatomic,assign)ibinspectable cgfloat cornerradious;
/............ Add the Ib_designable keyword to implementation ............/.../
Ib_designable
@implementation UIView (ibispectable)
-(void) Setcornerradious: (cgfloat) cornerradious{
Self.layer.cornerRadius = cornerradious;
Self.layer.masksToBounds = cornerradious>0;
}
-(CGFloat) cornerradious{
return Self.layer.cornerRadius;
}
To display the properties of a custom control on attribute Inspector