ios - Why isn't my logged-in segue working? -


i need bypass signup/login screen if user logged in. absolutely nothing happens. printing log works, know problem isn't viewdidload() function, , know pfuser.currentuser() not nil. not segue, same segue used on login button, , works in event. why isn't working automatically?

override func viewdidload() {     if pfuser.currentuser() != nil {         println(pfuser.currentuser())         self.performseguewithidentifier("jumptomenu", sender: self)     } } 

use following code , work.

 override func viewdidappear(animated: bool) { if pfuser.currentuser() != nil {     self.performseguewithidentifier("jumptomenu", sender: self) }} 

the trick use viewdidappear. code not work in viewdidload because code runs before view loads because of segues not in place. hope helps!


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - Bypass Geo Redirect for specific directories -

php - .htaccess mod_rewrite for dynamic url which has domain names -