Skip to content

Instantly share code, notes, and snippets.

@LukeSmith16
Last active April 8, 2023 23:19
Show Gist options
  • Save LukeSmith16/f56d5a869537f836da0f970017a230fc to your computer and use it in GitHub Desktop.
Save LukeSmith16/f56d5a869537f836da0f970017a230fc to your computer and use it in GitHub Desktop.
private lazy var backgroundSession: URLSession = {
let config = URLSessionConfiguration.background(withIdentifier: "LongRunningSession")
// System will trigger requests at the best time for optimal performance.
config.isDiscretionary = true
return URLSession(configuration: config, delegate: self, delegateQueue: nil)
}()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment