ScrollingStackContainer icon indicating copy to clipboard operation
ScrollingStackContainer copied to clipboard

Adding viewControllers as childsViewControllers

Open azamouchi opened this issue 5 years ago • 0 comments

Fixing issue #7

Only the view of the stack viewControllers is being added to the ScrollingStackController view, there is no refrence kept for the childViewController itself

So for example if we have our ScrollingStackContainer inside a UINavigationController, and it contains a tableView as one of it SubViewControllers, we can't access the navigationController to push a new viewController , this PR wil allow us to do the following

   // tableView delegate method
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        let vc = NewViewController(nibName: "NewViewController", bundle: nil)
        self.parent?.navigationController?.pushViewController(vc, animated: true)
    }

Assuming that self here references the viewController that control our tableView

azamouchi avatar Sep 15 '19 23:09 azamouchi