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
Improvements in 09b040f broke the following use case:
App has a single UINavigationController shared between home and account navigation coordinators
home coordinator shows the initial screens
account coordinator gets control over home.rootViewController when home creates and starts the account on user event (imagine showing an Account screen over the main app screen)
User uses the swipe-to-pop to close controller shown by account coordinator
Context before popping:
(lldb) po home.viewControllers
[HomeViewController]
(lldb) po account.viewControllers
[AccountViewController]
(lldb) po navigationController.viewControllers
[HomeViewController, AccountViewController]
When user performs swipe-to-pop gesture, didShowController gets called on account coordinator, but it returns on the check if lastIndex <= index { return } and therefore it:
don't remove AccountViewController from viewControllers
don't call handlePopBack(to:)
don't call parent?.coordinatorDidFinish(...)
The text was updated successfully, but these errors were encountered:
Thinking out-loud...it seems to me in all these cases where I just return from the didShowController(_), I should actually call parent?.coordinatorDidFinish(self, completion: {})
guardlet index = viewControllers.firstIndex(of: viewController)else{
parent?.coordinatorDidFinish(self, completion:{})return}...if lastIndex <= index {
parent?.coordinatorDidFinish(self, completion:{})return}
In the first case, shown VC is not in this Coordinator's domain, thus most likely this Coordinator is not active anymore. In the exit, it's the same thing.
Thus parent Coordinator should then figure out which Coordinator should be re-instated.
Improvements in 09b040f broke the following use case:
UINavigationController
shared betweenhome
andaccount
navigation coordinatorshome
coordinator shows the initial screensaccount
coordinator gets control overhome.rootViewController
whenhome
creates and starts theaccount
on user event (imagine showing an Account screen over the main app screen)account
coordinatorContext before popping:
When user performs swipe-to-pop gesture,
didShowController
gets called onaccount
coordinator, but it returns on the checkif lastIndex <= index { return }
and therefore it:AccountViewController
fromviewControllers
handlePopBack(to:)
parent?.coordinatorDidFinish(...)
The text was updated successfully, but these errors were encountered: