使用ECSlidingView更改viewControllers

时间:2014-03-16 16:22:24

标签: ios objective-c ecslidingviewcontroller

我有一个包含ECSlidingView的视图: The view, containing a slider (appears on the left when clicking the hamburger icon)

Bij点击“+”按钮,进入另一个视图,没有ECSlidingView:

Second view

现在,一旦用户点击第二个视图中的“Voeg Toe”按钮,我想返回第一个视图。我尝试过使用:

FoodViewController *myController = [self.storyboard instantiateViewControllerWithIdentifier:@"Voedingsdagboek"];
    [self presentViewController:myController animated:YES completion:nil];

然而,现在ECSlider不再起作用了。所以我无法浏览应用程序的其余部分。我该如何解决这个问题?

2 个答案:

答案 0 :(得分:0)

要返回上一个视图,您可以在popViewController方法中编写buttonTapped

[self.navigationController popViewControllerAnimated:YES];

答案 1 :(得分:0)

最终我使用以下方法修复了它:

self.slidingViewController.topViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Voedingsdagboek"];
[self.presentingViewController dismissViewControllerAnimated:YES completion:nil];
相关问题