I am just trying to get my head around MVC in Objective C and IOS but am having a problem I\'m hoping someone can help me with.
I have created a custom view (created as
Example for setting corner radius of your custom subview (subclass of UIButton in my case) from xib.
Create a property like this
@property (nonatomic, assign) IBInspectable CGFloat cornerRadius;
Override setter in your custom view's implementation file.
-(void)setCornerRadius:(CGFloat)cornerRadius
{
self.layer.cornerRadius = cornerRadius;
}
Drag your view in xib and change its class to your custom class.
Magic... You will see the custom properties appearing in attribute inspector like this.