I am working on a app that starts a timer when you begin holding the button, when you release from holding the button the timer must stop. I have a Touch Up Inside IBAction that starts the timer, but is there another UI Action I can use to detect that the user is still holding onto the button. I have another method for when it’s released. Can you guys help with logistics? Thanks!
Share
Start the timer on the control event
UIControlEventTouchDownand stop it on the control eventUIControlEventTouchUpInside.UIControlEventTouchDownwill fire once the user “presses down” on the button.UIControlEventTouchUpInsidewill fire once the user releases the button.If you want to see what state the button is in, check its
stateproperty.