Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Swift 中,UIControl似乎没有setEnabled:方法。有没有办法检测控制状态何时更改?
UIControl
setEnabled:
你可以在你的子类中做类似的事情:
override var enabled:Bool { didSet { //Your code } }
斯威夫特 3.0
override var isEnabled:Bool { didSet { //Your code } }
在 swift 3 中,现在是:
override var isEnabled: Bool { didSet { //Your code } }