I\'ve got a simple custom UIButton, to which I added:
button.layer.bordercolor = [[UIColor blueColor]CGColor];
However, I want to change the .b
You can override setHighlighted
and setSelected
methods in UIButton subclass. From there you just tweak border color like following:
- (void)setHighlighted:(BOOL)highlighted {
[super setHighlighted:highlighted];
[self tweakState:highlighted];
}
- (void)setSelected:(BOOL)selected {
[super setSelected:selected];
[self tweakState:selected];
}
- (void)tweakState:(BOOL)state {
if (state) {
self.layer.borderColor = [_highlightedBorderColor CGColor];
}
else {
self.layer.borderColor = [_defaultBorderColor CGColor];
}
}