Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // == JSON Login Signature
- static func loginUser(_ username:String, password:String, completion: @escaping (_ response: Int) -> Void)
- {
- ...
- }
- // ==== UIViewController calling it
- APIManager.loginUser(tUsername.text!, password: tPassword.text!) { [weak self] (respStatus: Int) in
- if(respStatus == 200) {
- APIManager.shared.currentUserState = APIManager.UserState.LoggedIn
- DispatchQueue.main.async {
- self?.newView()
- }
- } else {
- APIManager.shared.currentUserState = APIManager.UserState.LoggedOut
- }
- }
Add Comment
Please, Sign In to add comment