用户注销时返回初始视图控制器 [英] Return to initial view controller when user logs out

查看:128
本文介绍了用户注销时返回初始视图控制器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个使用Facebook集成的应用程序,而登录系统现在运行正常。但是,当用户点击退出时,我似乎无法返回到我的初始视图控制器。

I'm working on an app which uses Facebook integration, and the log in system works fine now. However, I can't seem to return to my initial view controller when the user clicks log out.

这里是我的故事板概述

我想在用户点击蓝色按钮时返回到开头(在顶部)。我该怎么做才能实现这一目标?如你所见,我有多个导航控制器,我只使用 Push-segues 来实现目标。但是,我确实使用了 SWRevealViewController ,你可以在中间看到。

I would like to return to the start when the user clicks the blue button (on the top). What would I do to achieve that? As you can see I have multiple Navigation Controllers, and I only use Push-seguesto get there. However, I do use the SWRevealViewController, which you can see in the middle.

我已经尝试了 [self.navigationController popToRootViewControllerAnimated:YES]; 哪个没有做任何事情。

I've tried [self.navigationController popToRootViewControllerAnimated:YES]; which doesn't do anything.

有什么建议吗?任何熟悉 SWRevealViewController 的人以及它对我的 Navigation 堆栈可能做了些什么?任何帮助将不胜感激!

Any advice? Anyone familiar with the SWRevealViewController and what it might have done to my Navigation stack? Any help will be appreciated!

谢谢。

推荐答案

试试这个,

UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"NameOfYourStoryBoard" 
                                                     bundle:nil];
LoginViewController *add = 
           [storyboard instantiateViewControllerWithIdentifier:@"viewControllerIdentifier"];

[self presentViewController:add 
                   animated:YES 
                 completion:nil];

这篇关于用户注销时返回初始视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆