Andrey Gordeev Andrey Gordeev - 16 days ago 5
iOS Question

Override UIButton's setEnabled method in Swift

In Swift,

UIControl
doesn't seem to have a
setEnabled:
method. Is there a way to detect when the control state was changed?

bzz bzz
Answer

You can do something like that in your subclass:

override var enabled:Bool{
        didSet {
            //Your code
        }
    }
Comments