Hi, Claude31
Can you explain precisely what you get ? What "shortened" means exactly ?
What I could get is:
- Push
- Go back
- Present
- Go back
- Push
Then I see the height being reduced just before displaying the detail
- when returning, height is reduced
Is it what you observe ?
You are absolutely right, the reduced height is a problem which I am pointing to.
I did not dig very deep, but if you replace this IBAction with a direct segue from the "Present" button to the PresentedViewController", you have not the problem anymore (that is what you did with push).
That is not right. I've just tried to make a direct segue to PresentedViewController (it wasn't embeded into UINavigationController), dismiss it and after push the UITabBar height is still reducing.
Why did you choose this complex set up and create a new navigation controller ?
This bug was first reproduced in a real production project. In this project I present a whole UINavigationController 'cause I need few navigatable screens to be presented. I don't really think that it is a complex set up. Anyway it is required to be embeded.
In addition, documentation
https://developer.apple.com/documentation/uikit/uisplitviewcontroller
states that
Note
You cannot push a split view controller onto a navigation stack. Although it is possible to install a split view controller as a child in some other container view controllers, doing is not recommended in most cases. Split view controllers are normally installed at the root of your app’s window. For tips and guidance about ways to implement your interface, see iOS Human Interface Guidelines.
Isn't it what you are doing ?
No, It's not. In a sample project there is a UITabBarController as a root screen, UISplitViewController is one of its tabs (the tab that's presenting).
So I don't push the UISplitViewController into navigation stack (iOS won't even let me do that) or put inside UIContainerView.
But there is one interesting thing I found out. If you'll change the Presentation property in IB of PresentedViewController from fullscreen to over fullscreen the bug will dissappear. So what the difference? The doc says:
Fullscreen
https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/fullscreen
The views belonging to the presenting view controller are removed after the presentation completes.
Over fullscreen
https://developer.apple.com/documentation/uikit/uimodalpresentationstyle/overfullscreen
The views beneath the presented content are not removed from the view hierarchy when the presentation finishes. So if the presented view controller does not fill the screen with opaque content, the underlying content shows through.
iOS uses fullscreen as a default presentation property value. I suppose that's in that paticular case the system somehow removes something. I guess it may be something related to safe area as this bug appears only on devices with safe area on bottom and the tabbar height is reduced exacly by a height of a safe area.
P.S. As this forum doesn't let to upload images I will put them into the github page of sample project.