Skip to content

Instantly share code, notes, and snippets.

View Monserg's full-sized avatar

SergeyM Monserg

View GitHub Profile
@Monserg
Monserg / URLSession Calls in Swift 4
Created March 15, 2018 08:37 — forked from cmoulton/URLSession Calls in Swift 4
URLSession Calls in Swift 4
func makeGetCall() {
// Set up the URL request
let todoEndpoint: String = "https://jsonplaceholder.typicode.com/todos/1"
guard let url = URL(string: todoEndpoint) else {
print("Error: cannot create URL")
return
}
let urlRequest = URLRequest(url: url)
// set up the session