Re: uitabbar translucency and hiding
Re: uitabbar translucency and hiding
- Subject: Re: uitabbar translucency and hiding
- From: Quincey Morris <email@hidden>
- Date: Sun, 21 Aug 2016 11:11:32 -0700
- Feedback-id: 167118m:167118agrif8a:167118sl72zsD8UG:SMTPCORP
On Aug 20, 2016, at 16:29 , Torsten Curdt <email@hidden> wrote:
>
> One would think this would be enough:
>
> if let tabBar = self.tabBarController?.tabBar {
> tabBar.hidden = !visible
> }
I’m no expert in iOS view controller behavior, but since no one has jumped in, I’ll contribute how I understand it.
Hiding the tab does NOT seem like a reasonable way to approach this. According to the UITabBarController documentation, “You should never access the tab bar view of a tab bar controller directly.” In any case, it’s the view *controller* that controls the geometry of the views it manages, so if the tab bar controller isn’t expecting the tab bar to be hidden, it likely has no way of “reclaiming” the tab bar view’s real estate without its own API for this.
So that leads to the question of why the view controller (apparently) has no API for properly hiding the tab bar. That (I believe) is because you’re not supposed to do that. According to the HIG, tab bar controllers are supposed to be used only at the top level of your controller hierarchy, and (I believe) it’s considered undesirable for your app’s UI to undergo as a radical change as losing its tab bar. In general, the user has no clue how to get it back, and loses the ability to switch directly between the areas of functionality the tabs represent.
(There appears to be one pragmatic exception to this. If the top level structure of your app uses a split view controller, it makes sense to have a tab view controller as the detail side of the split, because that “feels” like the stable part of the UI to the user, since the list side of the split can come and go.)
Of course, if you ignore the HIG and use a tab view controller within a navigation hierarchy, it (presumably) would be clearer to the user how to get it back. But since (I believe) it’s not supposed to be used that way, it has no functionality for hiding the tab bar.
FWIW.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden