Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user.signUpInBackground{ (success: Bool, error:Error?) in
- if success{
- print("signed up")
- UserDefaults.standard.set(user.username, forKey: "username")
- UserDefaults.standard.synchronize()
- user.signUpInBackground {(success: Bool, error: Error?) in
- if success {
- print("signed up")
- AVUser.logInWithUsername(inBackground: user.username!, password: user.password!, block: {(user: AVUser?, error: Error?) in
- if let user = user {
- UserDefaults.standard.set(user.username, forKey: "username")
- UserDefaults.standard.synchronize()
- let appDelegate: AppDelegate = UIApplication.shared.delegate as! AppDelegate
- appDelegate.login()
- }
- })
- }else {
- print(error!.localizedDescription)
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement