Skip to content

Instantly share code, notes, and snippets.

View RadwaEbrahim's full-sized avatar

Radwa Ibrahim RadwaEbrahim

  • NewStore
  • Berlin
View GitHub Profile
@cmoulton
cmoulton / URLSession Calls in Swift 4
Last active December 18, 2023 02:31
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