Skip to content

Instantly share code, notes, and snippets.

@bharathreddys77
Created May 23, 2021 07:26
Show Gist options
  • Save bharathreddys77/98cf7122235f51326a6c3ce58e8585c6 to your computer and use it in GitHub Desktop.
Save bharathreddys77/98cf7122235f51326a6c3ce58e8585c6 to your computer and use it in GitHub Desktop.
Controller which inputs username and password and trigger Api on click.
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