SWReveal普通推背

时间:2016-11-20 19:14:22

标签: ios objective-c swrevealviewcontroller

我有SWRevealViewController的故事板结构。一切正常,设置视图控制器等。现在,我在菜单上有一个图像导致配置文件,而不是SWReveal的结构。任何人都知道如何将它推送到根导航控制器和后退按钮以返回SWReveal

我试过这个:

RegistrationvViewController *vcSw = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"editProfile"];
[self presentViewController:vcSw animated:YES completion:nil];

我在SWReveal中嵌入NavigationController并尝试了performingSegueWithIdentifier,但也没有显示回来。

1 个答案:

答案 0 :(得分:0)

//如果您想从swreveal推送到任何控制器,那么您必须制作导航控制器

使用此代码

 UIStoryboard*Storyboard=[AppDelegate storyBoardType];
            yourController  *dashboard=(yourController*)[Storyboard instantiateViewControllerWithIdentifier:@"yourControllerId"];

            UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:dashboard];

            [navController setViewControllers: @[yourController] animated: YES];
            [self.revealViewController setFrontViewController:navController];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES]; 

//从控制器回到swreveal

[self.revealViewController revealToggleAnimated:YES];