Mvvmcross: MvxTabBarViewController cannot be shown as child

Created on 19 Jun 2017  路  10Comments  路  Source: MvvmCross/MvvmCross

Steps to reproduce

  1. Create a MvxTabBarViewController implementation
  2. Don't add any presenter attributes
  3. Launch app
  4. Navigate to TabBar from other VM which is root

Expected behavior

TabBar VC should be shown with a NavBar at the top allowing user to navigate back

Actual behavior

App crashes with exception saying MvxTabBarViewController cannot be shown as child

Adding [MvxRootPresentation(WrapInNavigationController = true)] does not help. No NavBar is shown still.

Configuration

Version: 5.0.3

Platform:

  • [x] iOS
  • [ ] Android
  • [ ] WPF
  • [ ] UWP
ios bug

All 10 comments

So removing the line from the previous comments allows me to navigate as I used to.

However, that might give the following consequence of it allowing to nest TabBarViewControllers, which is probably something the dev does not want to do.

Showing the TabBarViewController as root only is no go either, as it nukes the back stack and prevents me navigating back.

That check very clearly disallows what you are trying to do. The question is, should it? I think the answer is that it should be allowed but I also wonder why the check was added and what unforeseen consequences removing it will have.

I certainly do think this should be possible. It was possible right up until 5.x to have the behavior I had previously. I can't see why we should prevent it. Although, we probably should prevent nesting TabBarViewControllers inside each other.

I disallowed it because UITabBarController inside UINavigationController is kind of buggy on iOS 7. Also I did not test that scenario in the Playground, so it made sense to me not to include a feature that was not tested.

When I needed to do it in an app, a plain UIViewController with a UITabBar was enough.

With iOS 7 becomming older every day, I'm ok with removing the line you pointed out @Cheesebaron.

@nmilcoff iOS 7 and earlier is 5% or less of the market these days, likely safe to remove.

It is even less than 3% according to Apple AppStore.

Yah but what about a UITabController on a Detail View of a UISplitViewController - which is popular on a tablet?

@biozal I'd consider that a separate feature. Currently there is support for displaying a UINavigationController as Detail in a SplitView. But not for showing children inside that NavigationController

@biozal can you open a separate issue please?

Was this page helpful?
0 / 5 - 0 ratings