Skip to content

Instantly share code, notes, and snippets.

@nathanborror
Created January 30, 2018 18:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanborror/0a336c511fde088d5b9a0c21a9731aa8 to your computer and use it in GitHub Desktop.
Save nathanborror/0a336c511fde088d5b9a0c21a9731aa8 to your computer and use it in GitHub Desktop.
Simulate Slow Connection
let task = URLSession.shared.dataTask(with: req) { (data, response, error) in
...
}
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(4)) {
task.resume()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment