Jaleel Nazir Jaleel Nazir -5 years ago 1110
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.

Answer Source

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download