iOS Disabling a UIButton


Example

A button can be disabled by

Swift

myButton.isEnabled = false

Objective-C:

myButton.enabled = NO;

The button will become gray:

enter image description here

If you don't want the button appearance to change when disabled set adjustsImageWhenDisabled to false / NO