我有SWRevealViewController
的故事板结构。一切正常,设置视图控制器等。现在,我在菜单上有一个图像导致配置文件,而不是SWReveal
的结构。任何人都知道如何将它推送到根导航控制器和后退按钮以返回SWReveal
?
我试过这个:
RegistrationvViewController *vcSw = [[UIStoryboard storyboardWithName:@"Main" bundle:nil] instantiateViewControllerWithIdentifier:@"editProfile"];
[self presentViewController:vcSw animated:YES completion:nil];
我在SWReveal
中嵌入NavigationController
并尝试了performingSegueWithIdentifier
,但也没有显示回来。
答案 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];