Jaleel Nazir Jaleel Nazir - 10 months ago 480
iOS Question

Change UIButton BorderColor in Storyboard

I Set CornerRadius and BorderWidth for UIbutton in User Defined Runtime Attributes. Without adding layer.borderColor it works Well and Display border in black color. But when add layer.borderColor does not work(does not show border).

enter image description here

Thanks in Advance.


I got Answer Change layer.borderColor to layer.borderColorFromUIColor

enter image description here

and add the code in .m file

#import <QuartzCore/QuartzCore.h>
@implementation CALayer (Additions)

- (void)setBorderColorFromUIColor:(UIColor *)color
    self.borderColor = color.CGColor;


Tick properties in Attribute Inspector

Attribute Inspector