Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I disable a button in Xcode?

I am new to iPhone development. I am building an app by using Xcode but now would like to disable a button. How is this possible?

like image 250
ashish Avatar asked Feb 17 '09 07:02

ashish


3 Answers

myButton.enabled = NO;
like image 107
Alex Wayne Avatar answered Oct 26 '22 17:10

Alex Wayne


Via code:

myButton.enabled = NO;

If you're using interface builder there's an "enabled" option.

like image 32
Andrew Grant Avatar answered Oct 26 '22 16:10

Andrew Grant


If you are looking for a Swift 3.0 solution:

button.isEnabled = false
like image 34
dannrob Avatar answered Oct 26 '22 18:10

dannrob