SideMenu
SideMenu copied to clipboard
'Caching the Content' is not working
When I set any view controller as a content view controller for the first time then after the second time I don't want to load it again from the start. I just need to show the screen again without any changes.
Here what I have done in my project:
- Setup side menu programmatically
let sideMenucontroller = NavigationManager.shared.sideMenuController
let controller = NavigationManager.shared.dashboardNavController
sideMenucontroller.contentViewController = controller
appdelegate.window?.rootViewController = sideMenucontroller
- Cached all required controllers in 'dashboardNavController' which I have set up earlier
sideMenuController?.cache(viewController: NavigationManager.shared.dashboardNavController, with: "dashboardNavController")
sideMenuController?.cache(viewController: NavigationManager.shared.dashboardViewController, with: "dashboardViewController")
- Opened dashboard controller from the another view controller as mentioned in the document
sideMenuController?.setContentViewController(with: "dashboardNavController")-> By doing this dashboardViewController is appearing from start.
For example, what I need is:
Normally when view controller loads then it calls first viewDidload() and when view controller appears again then it will not load viewDidLoad() instead of it will start from viewWillAppear(), this behavior I need here.
Thanks in advance.
@parthsit Can you check whether lazyCachedViewControllerGenerators store the right view controller?