我的didEnterBackground函数有以下代码:
func applicationDidEnterBackground(_ application: UIApplication) {
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
Timer.after(5.seconds) {
print ("5 seconds have past in the background")
}
}
计时器计数,但在应用程序返回前台之前打印不会消失。我希望打印在应用程序进入后台5秒后关闭。