If a UIButton has been disabled by [myButton setEnabled:NO]; is it possible to use a touch listener that still works?
I have tried:
[self addTarget:self action:@selector(myButtonTUI:) forControlEvents:UIControlStateDisabled];
but to no avail.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer to your question is No
Can you simulate such functionality? Yes.
Instead of disabling the button, make a check to see if the functionality should fire on the buttons action selector. You can even change the image to make it look disabled. This way the button still receives touch events, and you can fire the required functionality if the correct conditions are met.