watchkit - Apple Watch display sleep pauses NSTimer, but WKInterfaceTimer keeps counting down -


as per apple documentation, 1 use both wkinterfacetimer (local watch, counts down not trigger event when ends) , nstimer (to trigger methods when timer ends). so, have both nstimer , wkinterfacetimer in app interface controller. on simulator, on schemes when watchapp runs, nstimer & wkinterfacetimer keep counting down (as should) when watch either in awake or sleep mode (using simulator lock/unlock, instructed in apple's manual).

however, on real physical watch, 2 timers behave differently upon watch display sleep (blackout) , awake states. sleep mode pauses nstimer of interface controller, wkinterfacetimer keeps counting down (as should).

so, 2 timers run out of synch upon first physical apple watch sleep (nstimer pauses, wkinterfacetimer keeps counting down). seeking others experiences , whether implemented way keep both nstimer , wkinterfacetime in synch regardless of watch mode (sleep or awake).

it seems store end time of countdown (for example, in nsuserdefaults), on willactivate, re-set nstimer completes @ correct time. alternately, call iphone app schedule local notification, there no guarantee notification delivered watch, might not work you.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -