2016-10-02 29 views

回答

2

这不能做建议,您终止应用程序后,您的应用程序将在后台短时间内工作。

了解更多关于苹果开发者网站上的Background Execution

2

iOS应用程序无法在后台运行。当应用程序处于前台时,您可以处理连接(wifi,4g,无)的更改。或者你也可以添加背景的任务,给你更多的时间将数据保存到数据库等

方法被称为beginBackgroundTaskWithName:expirationHandler:在applicationDidEnterBackground。更多文件在这里执行有限长度的任务:https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html