0

I need to call some method repeatedly by holding down the UIButton. Once i released the Button it should stop calling that method. how can i implement this functionality do anyone having idea about this means please help me to get out of this issue..Thanks in Advance.

Yuva
  • 125
  • 3
  • 11

1 Answers1

5

You can use touchesBegan method to call this method and touchesEnd to stop this method.

Inside the method you can use some loop- for or while to call this method depending on condition, or you can start a timer to call this method in touchesBegan and invalidate the timer in touchesEnd.

rishi
  • 11,779
  • 4
  • 40
  • 59