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.
UIButton Touch and Hold
I don't want any repeating action.
Just add different selectors to the UIButton
based on different events. To set the selector for when you initially press down, do the following
[button addTarget:self action:@selector(buttonDown:) forControlEvents:UIControlEventTouchDown];
and the selector for when your button is released:
[button addTarget:self action:@selector(buttonUp:) forControlEvents:UIControlEventTouchUpInside];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With