[:en]Swift:”Warning: Attempt to present * on *whose view is not in the window hierarchy”[:]

[:en]Solution: ViewDidAppear

  override func viewDidAppear(animated: Bool) {
        super.viewDidAppear(animated)
        // Check login status
        let defaults = NSUserDefaults.standardUserDefaults()
        if let loginstatus = defaults.stringForKey("loginkey"){
            print("loginstatus: \(loginstatus)")
            if (loginstatus == "in"){
       
            }
        }else {

            // Call Button
            self.logoutbTn(logoutDisplay)
        }

     

[:]

Print Friendly, PDF & Email
Scroll to Top