Skip to content

Instantly share code, notes, and snippets.

@GE-N
Created July 26, 2015 08:10
Show Gist options
  • Save GE-N/812e5dd2344bb07e6a37 to your computer and use it in GitHub Desktop.
Save GE-N/812e5dd2344bb07e6a37 to your computer and use it in GitHub Desktop.
Blog snipper call api by swift enum params
let api = API()
let blogID = "1"
let title = "Hello my blog"
let body = "Hello world, this is my first blog entry"
// Create blog
api.blog(.CREATE(title, body))
// Read blog
api.blog(.READ(blogID))
// Update blog
let bodyChange = "Hello world, I love Swift's enum"
api.blog(.UPDATE(1, title, bodyChange)
// Delete blog
api.blog(.DELETE(1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment