Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continue block not executing for success case #55

Open
randhirkumarcse opened this issue Mar 22, 2017 · 0 comments
Open

Continue block not executing for success case #55

randhirkumarcse opened this issue Mar 22, 2017 · 0 comments

Comments

@randhirkumarcse
Copy link

In below code, continue block is executing only for failure cases but not for success cases.

QMServicesManager().authService.signUpAndLogin(with: user).continue({ (users: BFTask!) -> Any? in
if users.isFaulted || (users.error != nil) {
let alert = UIAlertController(title: "Error!", message: "Some error occurred on server", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
else if users.isCancelled {
let alert = UIAlertController(title: "Error!", message: "User registration is not completed", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
else if users.result != nil {
let alert = UIAlertController(title: "Done!", message: "User (users.result!.fullName) registration is successful", preferredStyle: UIAlertControllerStyle.alert)
alert.addAction(UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil))
self.present(alert, animated: true, completion: nil)
}
return nil
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant