title: Firebase Error Value of type 'AuthDataResult' has no member 'displayName'
body: <p>I'm following along Rob Percival's iOS developer course and I am currently stuck at the "Uber clone" project. Following is an extract of the problematic code. The line of code in which the error occurs is:</p>
  
  <pre><code>if user?.displayName == "Lehrer" {
  </code></pre>
  
  <p>which is found after the comment <code>//LOG IN</code></p>
  
  <pre><code>@IBAction func topTapped(_ sender: Any) {
      if emailTextField.text == "" || passwordTextField.text == "" {
          displayAlert(title: "Achtung", message: "Du musst sowohl eine Email-Adresse als auch Passwort eingeben!")
      } else {
          if let email = emailTextField.text {
              if let password = passwordTextField.text {
                  if signUpMode {
                      // SIGN UP
                      Auth.auth().createUser(withEmail: email, password: password, completion: { (user, error) in
                          if error != nil {
                              self.displayAlert(title: "Error", message: error!.localizedDescription)
                          } else {
  
                              if self.benutzerLehrerSwitch.isOn {
                                  //Lehrer
                                  let req = Auth.auth().currentUser?.createProfileChangeRequest()
                                  req?.displayName = "Lehrer"
                                  req?.commitChanges(completion: nil)
                                  self.performSegue(withIdentifier: "lehrerSegue", sender: nil)
                              } else {
                                  // RIDER
                                  let req = Auth.auth().currentUser?.createProfileChangeRequest()
                                  req?.displayName = "Benutzer"
                                  req?.commitChanges(completion: nil)
                                  self.performSegue(withIdentifier: "benutzerSegue", sender: nil)
                              }
                          }
                      })
                  } else {
                      // LOG IN
                      Auth.auth().signIn(withEmail: email, password: password, completion: { (user, error) in
                          if error != nil {
                              self.displayAlert(title: "Error", message: error!.localizedDescription)
                          } else {
                              if user?.displayName == "Lehrer" {
                                  // BENUTZER
                                  self.performSegue(withIdentifier: "benutzerSegue", sender: nil)
                              } else {
                                  // LEHRER
                                  self.performSegue(withIdentifier: "lehrerSegue", sender: nil)
                              }
                          }
                      })
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>Basically, I allow users to sign up as one of two different types of roles ("Lehrer" or "Benutzer") and depending on which of those they choose, they should see different screens after logging in. I use Firebase for the backend of this code and signing up User's accounts works fine if I delete the faulty code. Does anyone have any ideas?</p>
  
  <p>You can see the exact look in this screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/XMhi4.jpg" alt="Screenshot of the error"></p>