Created
May 2, 2016 13:21
-
-
Save gavrix/171a612cf1100b48a78803e05481b903 to your computer and use it in GitHub Desktop.
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
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