Skip to content

'Caching the Content' is not working #114

Description

@parthsit

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions