Created
July 26, 2015 08:10
-
-
Save GE-N/812e5dd2344bb07e6a37 to your computer and use it in GitHub Desktop.
Blog snipper call api by swift enum params
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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