0
votes

I'm using an open source class for sliding the view. The slide function works perfectly when the app launches, but when I change the view or call the segue method, and then come back to HomeViewController, the slide function stops working. It only works when the HomeVC is launched for the first time. Please help me here.

In AppDelegate.m file :

didFinishLaunchingWithOptions method is as below:

UIStoryboard *storybrd = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
HomeViewController *controller = [storybrd instantiateViewControllerWithIdentifier:@"ViewController2"];

// setup slide navigation view controller instance
MWFSlideNavigationViewController * slideNavCtl = [[MWFSlideNavigationViewController alloc] initWithRootViewController:controller];    
// slideNavCtl.panEnabled = YES;

self.window.rootViewController = slideNavCtl;
[self.window makeKeyAndVisible];
return YES;

didSelectRowAtIndexPath method is as below:

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

if(tableView == self.tableView1)
{




[self performSegueWithIdentifier: @"CommVC"
                          sender: self];
}}

prepareForSegue method is as below:

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

    CoViewController *destination =
    [segue destinationViewController];


    destination.name = _name;

 };
1

1 Answers

0
votes

Maybe when you change the viewController you do a modalPresentation instead of doing a push. So basically the slide doesn't work because it doesn't have a navigationController as rootviewController anymore.

Please show what are you doing there when you change the view.