Threaded NSTimer

前端 未结 1 1836
太阳男子
太阳男子 2021-01-23 14:21

I am aware of the many questions regarding this topic, as I myself have asked one previously however, my issue now seems to be more related to the threading part. I have the fol

相关标签:
1条回答
  • 2021-01-23 15:19

    You can use a bool to know if you have a timer running or not. When you start the timer you set it to true, when you stop the timer you set it to false. When resume timer function is called you check this variable and if it's true you do not start a new timer.

    Another solution would be to limit user interaction with the button. If the button is pressed you make it inactive for a time.

    0 讨论(0)
提交回复
热议问题