Skip to content

Instantly share code, notes, and snippets.

@alexiscreuzot
Last active December 25, 2015 23:22
Show Gist options
  • Save alexiscreuzot/4fab911c64bb724d0934 to your computer and use it in GitHub Desktop.
Save alexiscreuzot/4fab911c64bb724d0934 to your computer and use it in GitHub Desktop.
public var method: Alamofire.Method {
switch self {
case .Colors:
return Alamofire.Method.GET
case .AddColor:
return Alamofire.Method.POST
}
}
public var path: String {
switch self {
case .Colors,
case .AddColor:
return "/colors"
}
}
public var parameters: [String : AnyObject] {
switch self {
case .Colors(let search):
return ["format":"json", "search":search]
case .AddColor(let color):
return color.asDictionary()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment