I am trying to implement ECSlidingViewController & I am using segues in my storyboards. I am having a problem where the MainViewController's viewDidLoad is being called twice and
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
is always getting set to null. More information.
- LogIn Screen ( InitViewController ) ------through segue---------> MainViewController.
In my MainViewController I have the following code.
-(void)addMenuViewControllerWithGesture{
self.view.layer.shadowOpacity = 0.075f;
self.view.layer.shadowRadius = 10.0f;
self.view.layer.shadowColor = [UIColor blackColor].CGColor;
if (![self.slidingViewController.underLeftViewController isKindOfClass:[rsMenuViewController class]]) {
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
}
}
In My InitViewController (LogIn)
-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
MainViewController *controller = segue.destinationViewController;
// setting some values before going to the next view.
controller.id = 0;
controller.name = @"harish";
self.topViewController = controller;
}
By doing this, the MainViewController's viewDidLoad is getting called twice and the below value is always set to null.
self.slidingViewController.underLeftViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"Menu"];
Hope it's clear. I am kind of stuck here and looking for a solution.
Thanks