RxFlow icon indicating copy to clipboard operation
RxFlow copied to clipboard

Unbalanced calls to begin/end transition warning when using TabBar

Open lukasburns opened this issue 5 years ago • 5 comments

Hi, ive managed to hook up RxFlow to my proyect which currently has an AppFlow which shows a MainFlow, but im getting a warning Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x7fc7e77079f0>

AppFlows's root is a UINavigationController while MainFlow's root is a UITabBarController with 3 tabs( 1 flow for each tab ). The code on my navigateToMain in MainFlow is as follows

Flows.whenReady(
      flow1: recipesFlow,
      flow2: cookFlow,
      flow3: settingsFlow) { [unowned self] (root1, root2, root3) in

    ... configure tab bar items...

      self.rootViewController.setViewControllers([root1, root2, root3], animated: false)
    }

    return .multiple(flowContributors: [
      .contribute(
        withNextPresentable: recipesFlow,
        withNextStepper: OneStepper(withSingleStep: KitchenConnectStep.recipesAreRequired)),
      .contribute(
        withNextPresentable: cookFlow,
        withNextStepper: OneStepper(withSingleStep: KitchenConnectStep.cookIsRequired)),
      .contribute(
        withNextPresentable: settingsFlow,
        withNextStepper: OneStepper(withSingleStep: KitchenConnectStep.settingsAreRequired))
    ])

it seems to have something to do with presenting one view controller before the other has completely loaded, but i cant figure out how to make this warning dissapear.

Have you encountered a similar warning?

thanks

btw: Great Library!

lukasburns avatar Feb 25 '20 19:02 lukasburns

Hi @lukasburns

Can you share the whole project ?

Thanks.

twittemb avatar Feb 26 '20 16:02 twittemb

Hi @lukasburns

I remember a workaround I had to use for such a message in the RxFlow Demo Application: Take a look at the DispatchQueue.main.async

    Flows.whenReady(flow1: onboardingFlow) { [unowned self] root in
        DispatchQueue.main.async {
            self.rootViewController.present(root, animated: true)
        }
    }

Not sure it will help. Please note this is a workaround and should not have to be done but I have to dig further to make it right.

twittemb avatar May 14 '20 21:05 twittemb

Any update on this, for some reason I can't even present another view controller on top of a root view controller that is a UIViewController without the error: Warning: Attempt to present <UIViewController: 0x10750e8e0> on <UIViewController: 0x1075d3480> whose view is not in the window hierarchy!

bryan-vh avatar Jul 31 '20 07:07 bryan-vh

Hi @bryan-vh

can you share your flows ?

thanks.

twittemb avatar Aug 01 '20 21:08 twittemb

hello @twittemb I'm working on a stack and I have the same concerns. As there was no feedback to reproduce the bug it is reproducible on my stack.

https://github.com/weareopensource/Swift

produced in navigationToDashboardScreen() or navigateToDashboard(), I'm digging into the subject a bit, but I haven't found a solution yet. DispatchQueue.main.async seems not to work.

(beginner in swift)

PierreBrisorgueil avatar Oct 29 '20 11:10 PierreBrisorgueil

This issue has not received any recent updates. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please leave a comment below and auto-close will be canceled.

github-actions[bot] avatar Jun 06 '23 01:06 github-actions[bot]

This issue has automatically been closed due to inactivity.

github-actions[bot] avatar Jun 21 '23 00:06 github-actions[bot]