Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/swift/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 注销-返回登录页面_Ios_Swift_Segue - Fatal编程技术网

Ios 注销-返回登录页面

Ios 注销-返回登录页面,ios,swift,segue,Ios,Swift,Segue,我的应用程序结构如图所示 在myProfileViewController选项卡中,有一个注销按钮 我想弹出窗口回到RegisterViewController 如果用户已经注册,我将绕过应用程序委托中的注册屏幕,如图所示 if (prefs.boolForKey("registered")){ self.window?.rootViewController = storyboard.instantiateViewControllerWithIdentifier("tabBarVi

我的应用程序结构如图所示

在my
ProfileViewController
选项卡中,有一个注销按钮

我想弹出窗口回到
RegisterViewController

如果用户已经注册,我将绕过
应用程序委托中的注册屏幕,如图所示

if (prefs.boolForKey("registered")){
       self.window?.rootViewController = storyboard.instantiateViewControllerWithIdentifier("tabBarViewController")
} else { // there is no current user
            // set up app for new or non logged in user
       self.window?.rootViewController = storyboard.instantiateViewControllerWithIdentifier("registerViewController")
}

我不确定这是否会影响如何导航回去,因为它正在设置
rootViewController

在过去,我将应用程序结构化为始终通过登录视图。然后,我运行一个自动身份验证操作,将以前经过身份验证的用户推送到应用程序的登录部分。然后,当用户希望注销时,我只需使用一个“放松”序列弹出,返回到应用程序的登录部分

以下是Ray Wenderlich团队提供的一个放松环节指南:


希望这有帮助

无法向后导航,因为
RegisterViewController
不在导航堆栈中。您只需将窗口的
rootViewController
设置为
RegisterViewController
,就像在应用程序启动时一样。