Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Caching the Content' is not working #114

Open
parthsit opened this issue May 18, 2020 · 1 comment
Open

'Caching the Content' is not working #114

parthsit opened this issue May 18, 2020 · 1 comment

Comments

@parthsit
Copy link

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:

  1. Setup side menu programmatically
let sideMenucontroller = NavigationManager.shared.sideMenuController
let controller = NavigationManager.shared.dashboardNavController
sideMenucontroller.contentViewController = controller
appdelegate.window?.rootViewController = sideMenucontroller
  1. 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")
  1. 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.

@kukushi
Copy link
Owner

kukushi commented May 25, 2020

@parthsit Can you check whether lazyCachedViewControllerGenerators store the right view controller?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants