Skip to content

Instantly share code, notes, and snippets.

@chriswebb09
Created May 11, 2017 09:49
Show Gist options
  • Save chriswebb09/40b87c40fdb0890c11c2f822cabcc844 to your computer and use it in GitHub Desktop.
Save chriswebb09/40b87c40fdb0890c11c2f822cabcc844 to your computer and use it in GitHub Desktop.
extension iTunesAPIClient: URLSessionDelegate {
internal func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession) {
if let appDelegate = UIApplication.shared.delegate as? AppDelegate,
let completionHandler = appDelegate.backgroundSessionCompletionHandler {
appDelegate.backgroundSessionCompletionHandler = nil
DispatchQueue.main.async {
completionHandler()
}
}
}
// Other networking functionality
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment