首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何删除SWRevealViewController?

如何删除SWRevealViewController?
EN

Stack Overflow用户
提问于 2013-12-10 00:24:38
回答 2查看 822关注 0票数 0

我在我的iPhone应用程序中使用SWRevealViewController

成功登录后,我将从我的视图控制器创建SWRevealViewController。

代码语言:javascript
复制
        profileView *frontViewController = [[profileView alloc] init];
        RearViewController *rearViewController = [[RearViewController alloc] init];

        UINavigationController *frontNavigationController = [[UINavigationController alloc] initWithRootViewController:frontViewController];
        UINavigationController *rearNavigationController = [[UINavigationController alloc] initWithRootViewController:rearViewController];

        SWRevealViewController *revealController = [[SWRevealViewController alloc] initWithRearViewController:rearNavigationController frontViewController:frontNavigationController];
        revealController.delegate = self;



       frontViewController.user_id = [defaults objectForKey:@"userid"];
        appDelegate.user_id = [defaults objectForKey:@"userid"];
        [self.navigationController pushViewController:revealController animated:YES];

现在,我想注销并返回到viewcontroller。我试过poptoRootviewcontroller,但不起作用。该怎么做呢?

EN

回答 2

Stack Overflow用户

发布于 2014-01-14 05:04:35

尝试这个-从您的前面/后面的viewController呼叫:

代码语言:javascript
复制
[self.revealViewController.navigationController popViewControllerAnimated:YES];
票数 0
EN

Stack Overflow用户

发布于 2014-06-27 15:05:56

在您的操作中尝试此代码:

代码语言:javascript
复制
ViewController *vc = [[ViewController alloc]init];
        UINavigationController *nvc = [[UINavigationController alloc]initWithRootViewController:vc];

        [reveal pushFrontViewController:nvc animated:YES];
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20475503

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档