Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// Get user's info form the database
- ///
- /// - Parameter completed: Completition Block
- func getInfo(completed: @escaping DownloadComplete){
- let token = self.getToken()
- print(self.getError())
- if(token != nil && token != ""){
- //Here is where I check credentials.
- self.checkCredentials(completed: {
- let url = "(Base_URL)(myInfo)(self.getToken() ?? "")"
- Alamofire.request(url, method: HTTPMethod.get).responseJSON { respone in
- if let result = respone.result.value as? Dictionary<String, AnyObject>{
- if let user = result["User"] as? Dictionary<String, AnyObject>{
- var Info = Alumno()
- if let id = user["id"] as? Int64!{
- Info.id = id
- }
- ...
- self.userInfo = Info
- completed()
- }
- }
- }
- })
- }
- }
- {
- "Status": "Success"
- }
Add Comment
Please, Sign In to add comment