I've my own custom button implemented and this works well.
import Foundation
import UIKit
class GhostYouButton: UIButton {
required public init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
}
override var isEnabled: Bool {
didSet {
if (self.isEnabled == false) {
self.backgroundColor = UIColor.clear
self.titleLabel?.textColor = Constant.disabledGrayColor
self.tintColor = Constant.disabledGrayColor
self.borderColor = Constant.disabledGrayColor
self.borderWidth = 2
self.cornerRadius = 20
} else {
self.backgroundColor = UIColor.clear
self.titleLabel?.textColor = Constant.mainGreenColor
self.tintColor = Constant.mainGreenColor
self.borderColor = Constant.mainGreenColor
self.borderWidth = 2
self.cornerRadius = 20
}
}
}
}
I set my GhostYouButton to be disabled in the viewDidLoad():
override func viewDidLoad() {
self.nextButton.isEnabled = false
}
So it turns gray like I expect it to:
However... as you can see the title on the UIButton is faded out. I want this to be the exact same color as the border. How do I make this happen?