Wednesday, April 22, 2026
HomeiOS Developmentios - How one can obtain it, after logging into the app,...

ios – How one can obtain it, after logging into the app, examine firebase and resolve which viewcontroller to enter

[ad_1]

I need to obtain firebase
key: Security-Verify,

worth: “admin” into view “adminVC”,
Worth: “ON” into view “MainTabBarController”,

With out this key: Security-Verify into view “SignUpViewControllerID”

Under is my present code but it surely would not work, hope somebody can provide me some recommendation, thanks

 Database.database().reference().little one("ID/(self.uid)/Profile/Security-Verify").observeSingleEvent(of: .worth, with: {
                                (snapshot) in
                    let cheak = "Security-Verify"
                    if cheak == "admin" {
                        
                        if let viewController = self.storyboard?.instantiateViewController(withIdentifier: "AdminVC") {
                            GetWindow()?.rootViewController = viewController
                            GetWindow()?.makeKeyAndVisible()
                    }
                    if cheak == "ON" {
                        if let viewController = self.storyboard?.instantiateViewController(withIdentifier: "MainTabBarController") {
                            GetWindow()?.rootViewController = viewController
                            GetWindow()?.makeKeyAndVisible()
      
                    }else{
                        if let viewController = self.storyboard?.instantiateViewController(withIdentifier: "SignUpViewControllerID") {
                            GetWindow()?.rootViewController = viewController
                            GetWindow()?.makeKeyAndVisible()

[solved]Query 2. Yellow Warning: ‘keyWindow’ was deprecated in iOS 13.0: Shouldn’t be used for purposes that assist a number of scenes because it returns a key window throughout all related scenes.

How ought to I modify it to repair this downside?

UIApplication.shared.keyWindow?.rootViewController = viewController

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments