Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func signIn(_ sender: UIButton) {
- let user = PFUser()
- let username = emailTF.text
- user.email = username
- user.password = passwordTF.text
- let spinner: UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRect(x: 0, y: 0, width: 150, height: 150)) as UIActivityIndicatorView
- if user.email == "" || user.password == "" {
- self.alert(message: "Введите email или пароль ", title: "Ошибка")
- } else {
- PFUser.logInWithUsername(inBackground: username! , password: passwordTF.text!) { (user, error) in
- spinner.stopAnimating()
- if user != nil {
- //if user!["emailVerified"] as! Bool == true {
- self.loadMenuScreen()
- self.alert(message: "Вы успешно вошли ", title: "BRAVOBET")
- spinner.stopAnimating()
- // }
- }else {
- if let descrip = error?.localizedDescription{
- self.displayErrorMessage(message: (descrip))
- }
- }
- }
- }
- }
- func loadMenuScreen(){
- let MenuVC = self.storyboard?.instantiateViewController(withIdentifier: "ViewController") as!ViewController
- self.present(MenuVC, animated: true, completion: nil)
- }
Add Comment
Please, Sign In to add comment