Skip to content

Instantly share code, notes, and snippets.

@gavrix

gavrix/Enums.swift

Created May 2, 2016
Embed
What would you like to do?
enum EndPoints {
case GetUser
case UpdateUser(userData: User)
}
extension ParseEndpoints: HTTPEndPointConvertible, HTTPEndPointDSL {
func toHTTPEndPoint() -> HTTPEndPoint {
let baseURL = "https://api.parse.com/1"
switch (self) {
case .GetUser:
return GET("\(baseURL)/user")
case .UpdateUser(let userData):
return PUT("\(baseURL)/user") {
$0.params = userData
$0.encoding = .JSON
}
...
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.