swift NSTimer in Background

前端 未结 2 1565
面向向阳花
面向向阳花 2020-11-29 13:37

I have come across a lot of issues with how to handle NSTimer in background here on stack or somewhere else. I\'ve tried one of all the options that actually made sense .. t

2条回答
  •  眼角桃花
    2020-11-29 14:19

    Unfortunately, there is no reliable way to periodically run some actions while in background. You can make use of background fetches, however the OS doesn't guarantee you that those will be periodically executed.

    While in background your application is suspended, and thus no code is executed, excepting the above mentioned background fetches.

提交回复
热议问题