Disabling a UIButton
suggest changeA button can be disabled like this:
Swift
myButton.isEnabled = false
Objective-C:
myButton.enabled = NO;
The button will become gray:
If the button should not gray out when it is disabled, set adjustsImageWhenDisabled to false in Swift or NO in Objective-C. That property affects the image, not a title-only button.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents