Skip to content

Commit

Permalink
#7 dataResponse 에 통신 결과 담기
Browse files Browse the repository at this point in the history
  • Loading branch information
seondal committed Dec 24, 2021
1 parent 79b5071 commit d92520e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
Binary file not shown.
14 changes: 14 additions & 0 deletions DalTube/DalTube/Login/UserSignService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,19 @@ struct UserSignService {
]

let dataRequest = AF.request(url, method: .post, parameters: body, encoding: JSONEncoding.default, headers: header)

dataRequest.responseData { dataResponse in
switch dataResponse.result {
case .success :
guard let statusCode = dataResponse.response?.statusCode else {return}
guard let value = dataResponse.value else {return}
let networkResult = self.judgeLgoinStatus(by: stautsCode, value)
completion(networkResult)

case .failure(let err) :
print(err)
completion(.networkFail)
}
}
}
}

0 comments on commit d92520e

Please sign in to comment.