Disabling a UIButton

suggest change

A 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.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents