Skip to content

Instantly share code, notes, and snippets.

@JillevdW
Created December 15, 2017 13:52
Show Gist options
  • Select an option

  • Save JillevdW/3f525a4189c96147fe31c50aa3524502 to your computer and use it in GitHub Desktop.

Select an option

Save JillevdW/3f525a4189c96147fe31c50aa3524502 to your computer and use it in GitHub Desktop.
URLSession.shared.dataTask(with:url!, completionHandler: {(data, response, error) in
guard let data = data, error == nil else { return }
do {
let json = try JSONSerialization.jsonObject(with: data, options: .allowFragments) as! [String:Any]
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment