You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 NavigationCoordinatorreturn .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 NavigationCoordinatorfrom inside a route handled by different NavigationCoordinator?
case .subRoute:
addChild(SubCoordinator(rootViewController: rootViewController))
return .none()
}
The text was updated successfully, but these errors were encountered:
chefnobody
changed the title
Nesting push-able Coordinators inside a NavigationCoordinator
Question re: nesting push-able Coordinators inside a NavigationCoordinatorMay 19, 2021
Everything works as expected. It's not yet clear to me why. Perhaps providing an initialRoute does not explicitly perform the animation and the trigger ensures that it does.
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 rootNavigationCoordinator
.However I haven't sorted out to do this with either a
RedirectionRouter
or some other type ofCoordinator
. If I make my sub Coordinator aNavigationCoordinator
and then in response to a Route transition on the root-levelNavigationCoordinator
return .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
NavigationCoordinator
from inside a route handled by differentNavigationCoordinator
?The text was updated successfully, but these errors were encountered: