Skip to content

Instantly share code, notes, and snippets.

@sandeeplearner
Created September 14, 2016 13:21
Show Gist options
  • Save sandeeplearner/57489e3eb83f51cb5d545db67fd0063b to your computer and use it in GitHub Desktop.
Save sandeeplearner/57489e3eb83f51cb5d545db67fd0063b to your computer and use it in GitHub Desktop.
import Foundation
import Alamofire
class FriendsListController {
func fetchFriendsList(forUser user : User, completionBlock block : (NSError?) -> ()) {
Alamofire.request(.POST, (NSURL(string: "http://idontknowurl.com/getFriendsList"))!, parameters: ["userId" : user.id,"friendsLevel" : "Gmail"], encoding: .URL, headers: ["username" : user.username, "password" : user.password]).response {
response in
//process response here
//configure user
//if no error
block(nil)
//else configure the error
//completionBlock(error)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment