Implement tintColorDidChange
in your UIButton subclass. iOS changes the tintColor of your button to gray, but borderColor of the layer is still the old blue color. You have to change borderColor yourself, there is no way that iOS knows that the border should be colored like your tint.
- (void)tintColorDidChange {
[super tintColorDidChange];
[self setNeedsDisplay];
}
After you used setNeedsDisplay
the system will call drawRect:
, which should update the layer color.
You could probably use this as well:
- (void)tintColorDidChange {
[super tintColorDidChange];
[[self layer] setBorderColor:self.tintColor.CGColor];
}