Skip to content

Instantly share code, notes, and snippets.

@nazmulkp
Created November 27, 2016 17:04
Show Gist options
  • Save nazmulkp/a0e8b54064d4d6facaa4d79ae673f649 to your computer and use it in GitHub Desktop.
Save nazmulkp/a0e8b54064d4d6facaa4d79ae673f649 to your computer and use it in GitHub Desktop.
iOS Apps with REST APIs
Basic set up for API
@nazmulkp
Copy link
Author

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment