E
E
Emil2021-06-14 00:36:00
Swift
Emil, 2021-06-14 00:36:00

The modal window doesn't open, what's wrong?

Greetings! I study authorization with FireBase, I check for authorization, and if == false, I throw it on a modal window with registration.
Checking authorization:

Auth.auth().addStateDidChangeListener { Auth, user in
            if(user == nil) {
                print("User == nil")
                self.showModalAuth()
            }
        }

I create a modal window:
func showModalAuth() {
        let storyboard = UIStoryboard(name: "Main", bundle: nil)
        let newvc = storyboard.instantiateViewController(withIdentifier: "SignInApp") as! SignInApp
        self.window?.rootViewController?.present(newvc, animated: true, completion: {
            print("Enter in newVC")
        })
    }

But nothing happens .
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Emil, 2021-06-14
@DyadyaEmil

Got it! These manipulations must be performed not in the AppDelegate but in the SceneDelegate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question