     override func viewDidLoad() {
         super.viewDidLoad()
         
+        self.hideKeyboard()
+        
     }
     
     override func viewDidAppear(_ animated: Bool) {
         
         // Check if there is a UID, then perform segue
         if let _ = KeychainWrapper.standard.string(forKey: gKeyUID) {
+            print("ID found in keychain")
             performSegue(withIdentifier: "goToFeed", sender: nil)
         }
     }

        
        // Sign in with a users email and password through Firebase
        if let email = emailField.text, let password = passwordField.text {
            FIRAuth.auth()?.signIn(withEmail: password, password: email, completion: { (user, error) in
                if error == nil {
                    print("User authenticated with email")
                    if let user = user {
                        self.completeSignIn(id: user.uid)
                    }
                } else {
                    FIRAuth.auth()?.createUser(withEmail: email, password: password, completion: { (user, error) in
                        if error != nil {
                            print("Unable to authenticate with Firebase using email")
                        } else {
                            print("Successfully authenticated with Firebase")
                        }
                    })
                }

    }
}

extension UIViewController
{
    func hideKeyboard()
    {
        let tap: UITapGestureRecognizer = UITapGestureRecognizer(
            target: self,
            action: #selector(UIViewController.dismissKeyboard))
        
        view.addGestureRecognizer(tap)
    }
    
    func dismissKeyboard()
    {
        view.endEditing(true)
    }
}

