RxFlow icon indicating copy to clipboard operation
RxFlow copied to clipboard

Child View Controllers with own flows

Open grafele opened this issue 7 years ago • 5 comments

Hi!

I wanted to ask if child view controllers with their own flows are currently supported by RxFlow. If I understand the source code right, the FlowCoordinator won't be removed until it's parent was dismissed. I can think about cases where the parent won't be dismissed at all and we add/remove child view controllers continuously. That would lead to a situation with many FlowCoordinators lying around without a way of deleting them.

Please correct me if I'm wrong.

grafele avatar Feb 08 '18 18:02 grafele

Hi,

A FlowCoordinator is removed when its associated root ViewController is dismissed. Indeed, if the root is not dismissed the FlowCoordinator will stay around.

Honestly, I have never tried RxFlow with Child ViewControllers. It is a good studying case. If I find a little time I will try it. If you try it on your side first, please come back to me within this issue.

twittemb avatar Feb 08 '18 18:02 twittemb

Ok, good to know. I plan to use it in our current project and I will create a pull request when I implement the necessary changes. I really like RxFlow!

grafele avatar Feb 08 '18 18:02 grafele

Hi @grafele

I'd like to try this Child ViewController thing :-) Can you describe what you have in mind in terms of navigation between these Child ViewControllers a little bit ? We can compare our results at the end ...

thx.

twittemb avatar Feb 09 '18 02:02 twittemb

Hi @twittemb

There are actually two things we need to add to get child view controller support:

  1. Clean up should work with them as well. But that's super easy.
  2. We need a way to pass the container view into the navigation step. It's already possible to add it to the enum case for that step, but I think we need a better abstraction there.

I would try to combine this with the case of popovers or other dialogs that need a source view. We need a way to have access to these views in the Flow. Don't have any idea yet how to do it without having the view model know about the view.

grafele avatar Feb 09 '18 08:02 grafele

@grafele it feels like you are asking for something relating to what I am asking for in #24

Have a look at my example, which works but executes with nasty warnings https://github.com/Sajjon/RxFlowExample

Sajjon avatar Feb 12 '18 12:02 Sajjon