can't start beginBackgroundTask swift 3
Sorry I am stuck, but I am trying to start background task (XCode8, swift 3) Example from here: https://developer.apple.com/library/content/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BackgroundExecution/BackgroundExecution.html#//apple_ref/doc/uid/TP40007072-CH4-SW3 In AppDelegate.swift: func applicationDidEnterBackground(_ application: UIApplication) { var bgTask: UIBackgroundTaskIdentifier = 0; bgTask = application.beginBackgroundTask(withName:"MyBackgroundTask", expirationHandler: {() -> Void in print("The task has started") application.endBackgroundTask(bgTask) bgTask =