         if userNameTextField.text?.isEmpty ?? true {
             return
         }
+        spinner.startAnimating()
         apiManager.verifyUser(userNameTextField.text!) { (successful, result, serverError, error) -> () in
             if successful {
                 guard let userName = result else {return}

class LoginViewController: UIViewController {

    @IBOutlet weak var userNameTextField: UITextField!
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }


                alert.addAction(UIAlertAction(title: "Ok", style: UIAlertActionStyle.Default, handler: nil))
                self.presentViewController(alert, animated: true, completion: nil)
            }
            self.spinner.stopAnimating()
        }
        
        
