How do i set up a button (IBAction and UIButton attached) to continue to run the IBAction or a function while the button is being pressed, running a functioning continuously until the button is let up.
Should i attach a value changed receiver?
Simple question, but I can’t find the answer.
Add a dispatch source iVar to your controller…
Then, in your touchDown action, create the timer that fires every so many seconds. You will do your repeating work in there.
If all your work happens in UI, then set queue to be
and then the timer will run on the main thread.
Now, make sure to register for both touch-up-inside and touch-up-outside
Make sure you destroy the timer