My app's root has a NavigationCoordinator which is fine.
However, one of the Routes it responds to pushes a ViewController that has many possible Routes and is it self fairly complicated. I'd like to hide all of its Routes and complexity inside another Coordinator that also pushes onto the root NavigationCoordinator.
However I haven't sorted out to do this with either a RedirectionRouter or some other type of Coordinator . If I make my sub Coordinator a NavigationCoordinator and then in response to a Route transition on the root-level NavigationCoordinator return .push(subCoordinator) I get the following UIKit exception for obvious reasons:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Pushing a navigation controller is not supported'
What's the right/idimoatic way to do this with XCoordinator? I can't find a precise example either in the sample project or the documentation.
Update:
If I do something like this my SubCoordinator's root screen is suddenly visible but w/o the push animation I'd expect. How might I ensure that push animation happens correctly? When I'm pushing a NavigationCoordinator from inside a route handled by different NavigationCoordinator?
case .subRoute:
addChild(SubCoordinator(rootViewController: rootViewController))
return .none()
}
My app's root has a
NavigationCoordinatorwhich is fine.However, one of the Routes it responds to pushes a ViewController that has many possible Routes and is it self fairly complicated. I'd like to hide all of its Routes and complexity inside another
Coordinatorthat also pushes onto the rootNavigationCoordinator.However I haven't sorted out to do this with either a
RedirectionRouteror some other type ofCoordinator. If I make my sub Coordinator aNavigationCoordinatorand then in response to a Route transition on the root-levelNavigationCoordinatorreturn .push(subCoordinator)I get the following UIKit exception for obvious reasons:What's the right/idimoatic way to do this with
XCoordinator? I can't find a precise example either in the sample project or the documentation.Update:
If I do something like this my SubCoordinator's root screen is suddenly visible but w/o the push animation I'd expect. How might I ensure that push animation happens correctly? When I'm pushing a
NavigationCoordinatorfrom inside a route handled by differentNavigationCoordinator?