如何在关闭应用程序时在后台运行快速应用程序?
答
iOS应用程序无法在后台运行。当应用程序处于前台时,您可以处理连接(wifi,4g,无)的更改。或者你也可以添加背景的任务,给你更多的时间将数据保存到数据库等
方法被称为beginBackgroundTaskWithName:expirationHandler:在applicationDidEnterBackground。更多文件在这里执行有限长度的任务:https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html