阅读背景:

iOS在非活动状态下执行动作(无用户交互)

来源:互联网 

How can I add a timer to my iOS app that is based on user interaction (or lack thereof)? In other words, if there is no user interaction for 2 minutes, I want to have the app do something, in this case navigate to the initial view controller. If at 1:55 someone touches the screen, the timer resets. I would think this would need to be a global timer so no matter which view you are on, the lack of interaction starts the timer. Although, I could create a unique timer on each view. Does anyone have any suggestions, links or sample code where this has been done before?How can I add a timer to my iOS app that is bas




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: