I’m using the scene coordinator in an app but theres an issue when push. When I push another viewController on the stack it works but if click back and try to push the same view controller I receive an error.
The error goes back to SceneCoordinator transition function and the message is that you can’t push a viewController if there’s no navigationController.
I am having the same problem. The SceneCoordinator doesn’t seem to have any knowledge about when the navigation controller back button is tapped (or an edge swipe back) which leaves the currentViewController property pointing to the wrong VC.
@fuadadetoro@robmaceachern
You need to make the Scene Coordinator a UINavigationControllerDelegate then implement the func navigationController(UINavigationController, didShow: UIViewController, animated: Bool) (or the willShow equivalent) callback.
Once you’ve done that, you can update the currentViewController with the new one and you should be all set.
We had to keep the code a reasonable size so the implementation you see in the book does not cover all cases. Setting your coordinator as a UINavigationControllerDelegate will help you cover more scenarii!