Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

how can i pause and resume NSTimer.scheduledTimerWithTimeInterval in swift?

0down votefavorite



i'm develop game, and i want create pause menu . i use

self.view?.paused =true

but NSTimer.scheduledTimerWithTimeInterval still running..

forvar i=0; i < rocketCount; i++{var a:NSTimeInterval=1 ii += a delaysShow =   2.0+((stimulus + interStimulus)* ii)var time3 =NSTimer.scheduledTimerWithTimeInterval(delaysShow!, target:self, selector:Selector("showRocket:"), userInfo: rocketid[i]
, repeats:false)}

I want time3 will be pause timer when player click pause menu and continue run the timer when player back to the game, but how i can paused NSTimer.scheduledTimerWithTimeInterval ? or any other solution for timer, in addition to nstimer, for call method and posible to pause ? help me please

iOS 8, swift

Posted on Apr 2, 2015 3:05 AM

Reply

There are no replies.

how can i pause and resume NSTimer.scheduledTimerWithTimeInterval in swift?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.