I’d like to implement a press and hold button. So when you push the button, function A executes, and when you release, function B executes. I found this, but it wasn’t what I was quite looking for.
I don’t want any repeating action.
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.
Just add different selectors to the
UIButtonbased on different events. To set the selector for when you initially press down, do the followingand the selector for when your button is released: