I\'ve got a simple custom UIButton, to which I added:
button.layer.bordercolor = [[UIColor blueColor]CGColor];
However, I want to change the .b
The SWIFT 2.x answer to your problem:
➜ Just override the highlighted property with "didSet" observer.
override var highlighted: Bool {
didSet {
switch highlighted {
case true:
layer.borderColor = UIColor.lightGrayColor().CGColor
case false:
layer.borderColor = UIColor.blackColor().CGColor
}
}
}
Swift 3:
override var isHighlighted: Bool {
didSet {
switch isHighlighted {
case true:
layer.borderColor = UIColor.lightGray.cgColor
case false:
layer.borderColor = UIColor.black.cgColor
}
}
}