Search code examples
iosobjective-cecslidingviewcontroller

Changing viewControllers with ECSlidingView


I have a view that contains a ECSlidingView: The view, containing a slider (appears on the left when clicking the hamburger icon)

Bij clicking the '+' button, you enter another view, without the ECSlidingView:

Second view

Now, I would like to return to the first view once a user clicks on the 'Voeg Toe' button in the second view. I have tried using:

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

However, now the ECSlider does not work anymore. So I cannot navigate through the rest of the application. How can I solve this?


Solution

  • Eventually I fixed it by using:

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