0

I am using Firebase authentication in swift iOS. When signing out, I am getting the following error:

whose view is not in the window hierarchy!

Below is the button action that is being performed, what should I follow, ignore it or in future it will give me some major issues?

@IBAction func signOut(_ sender: Any) {
    try! Auth.auth().signOut()
    self.performSegue(withIdentifier: "toLoginScreen1", sender: self)
}

}

koen
  • 5,383
  • 7
  • 50
  • 89
  • 4
    Possible duplicate of [Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy](https://stackoverflow.com/questions/11862883/attempt-to-present-uiviewcontroller-on-uiviewcontroller-whose-view-is-not-in-the) – koen Oct 03 '19 at 13:20
  • There's really not enough code her to know what the specific issue is - for example `self` could be out of scope or `the toLoginScreen1` could not exist. Also, you don't have any error handling which is why you don't know what the error is. The try should be enclosed in a `do {` block which will reveal more information about the error. See the bottom of this page [Password Authentication](https://firebase.google.com/docs/auth/ios/password-auth) which demonstrates proper error handling. – Jay Oct 03 '19 at 14:12

0 Answers0