Matt B.
Matt B.

Reputation: 73

Weird UIViewController hidesBottomBarWhenPushed layout bug that only occurs the very first time a view controller is pushed

I'm really at a loss with this one, especially considering it has previously been working fine and I can't find anything in my commits that would have broken it.

I have a UITabBarController as the master view of a UISplitViewController. Each tab in the UITabBarController has its own UINavigationController that manages a stack of child VCs.

The issue is that any child VCs that have hidesBottomBarWhenPushed set to true results in a glitchy transition, but only the very first time any UINavigationController push occurs.

Here is a video of the transition bug

As you can see, it appears as if the safe area is collapsing on transition (and indeed, this does not occur on iPad or any other iPhone that lacks a bottom safeAreaInset. Yet, on the second (and all subsequent) push, it behaves perfectly fine.

The only thing I can think of is that I'm implementing the UISplitViewControllerDelegate methods to ensure Show Detail segues occur as a push rather than a modal when on the iPhone. However, the issue still happens with a regular push (bypassing the delegate methods altogether).

The various view controllers are all the standard base classes with no overridden layout behaviour, and I'm not implementing any custom transitions or transition coordinators.

Any thoughts on what the issue might be would be greatly appreciated.

Upvotes: 1

Views: 251

Answers (1)

Matt B.
Matt B.

Reputation: 73

So I managed to fix it. I was performing a modal segue before the UITabBarController was coming on screen. Apparently that messes up the layout, as I was able to confirm via a minimal replication. Changing the segue presentation type to "over full screen" rather than "default" stops the underlying UITabBarController from being removed from the view hierarchy and fixes the issue.

While that's six hours of my life I'll never get back I hope it helps someone in future.

Upvotes: 1

Related Questions