I have integrated the MMDrawerController Library in an iOS application and now I have a requirement to Restore application state even though application is killed in background(Only when application is enter from foreground to background), it is working fine with normal navigation application but when I change Navigation using "setCenterViewController" option in my application, restoration is not working as expected and I have followed all instruction provided in this link: "https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/PreservingandRestoringState.html"
I have used setCenterViewController option(Recommended from MMDrawer) to navigates to particular screen and then deleted app in background , When we reopened it is launching with default initial screen but we are expecting it should reopen with Screen it has before Entering to Background.
and here is the code snippet:
AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
appDelegate.homeController.navigationController.navigationBarHidden = YES;
HomeViewController *homeVC = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:nil];
UINavigationController *_navg = [[UINavigationController alloc]initWithRootViewController:homeVC];
_navg.restorationIdentifier = @"homeNavigationController";
homeVC.title = [self.dataSource objectAtIndex:indexPath.row]; homeVC.restorationIdentifier = @"HomeViewController";
[appDelegate.drawerController setCenterViewController:_navg withCloseAnimation:YES completion:nil];
self.currentViewController = _navg;
self.currentViewController.restorationIdentifier = @"homeNavigationController";
Help me to resolve this issue.
not working as expected
- so what's happening then? what code did you add? what debugging have you done? what have you observed? – Broadleaf