Created
May 23, 2021 07:26
-
-
Save bharathreddys77/98cf7122235f51326a6c3ce58e8585c6 to your computer and use it in GitHub Desktop.
Controller which inputs username and password and trigger Api on click.
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
class LoginController:UIViewController { | |
private func loginUser() { | |
ServiceController().loginUser(request: LoginRequest(email: emailTF.text, password: passwordTF.text)) {[weak self] (result) in | |
self?.dismissProgressBar() | |
guard let self = self else { return } | |
switch result { | |
case .success(let response): | |
print("login success \(response)") | |
break | |
case .failure(let error): | |
print("login failed \(error)") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment