Closed Kondamon closed 1 year ago
Have added a convenience function to show initial root screen.
Thanks @Kondamon! I completely agree, it should not assert when going back to the root if we're already on the root, it should just do nothing.
However, I'm not sure I understand the usefulness of the convenience function. It should always be sufficient to call:
$routes.withDelaysIfUnsupported {
$0.goBackToRoot()
}
The goBack
family of methods work on both pushed and presented screens, so even if the stack contains a mixture of presented and pushed screens, there should be no need to call dismiss
in addition to goBackToRoot
. If you're seeing different behaviour, please could you describe it, as that would be a bug. Thanks!
In the meantime, I've merged your first commit and tagged a new version 0.2.4. Thanks for contributing!
@johnpatrickmorgan, I was initially thinking of UINavigationController behavior where you need to call popToRootViewController
and dismiss
any screens that are presented.
Ok, I got it! Thanks for clarification and the fast merge!
It doesn't make sense IMO to get an assert when going back to root if the root is already presented. Or is there any other way to show the initial screen (for e.g. deeplink handling):