Advertisement
Guest User

Untitled

a guest
Mar 22nd, 2017
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. user.signUpInBackground{ (success: Bool, error:Error?) in
  2. if success{
  3. print("signed up")
  4. UserDefaults.standard.set(user.username, forKey: "username")
  5. UserDefaults.standard.synchronize()
  6. user.signUpInBackground {(success: Bool, error: Error?) in
  7. if success {
  8. print("signed up")
  9. AVUser.logInWithUsername(inBackground: user.username!, password: user.password!, block: {(user: AVUser?, error: Error?) in
  10. if let user = user {
  11. UserDefaults.standard.set(user.username, forKey: "username")
  12. UserDefaults.standard.synchronize()
  13. let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
  14. appDelegate.login()
  15. }
  16. })
  17. }else {
  18. print(error!.localizedDescription)
  19. }
  20. }
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement