I have a UITabBarController and need to show the TabBar all the time. In a ViewController which represents a Tab, I present other Viewcontrollers with childViewController.modalPresentationStyle = .overCurrentContext. When I am presenting a ChildViewController (UIViewControllerA0,..), I show a Navigationbar. To go back, i dismiss the currentChildViewController.
This works fine, but the following steps Ends up with a black Screen.
- Selecting UIViewControllerA in Tabbar
- click something on UIViewControllerA and present(UIViewControllerA0)
- UIViewControllerA0 is shown with Navigationbar to go back
- Switch to Tab UIViewControllerC or B
- Switch to Tab UIViewControllerA -> Child UIViewControllerA0 is still available
- Go back on NavigationBar and dismiss UIViewControllerA0
- UIViewControllerA is a black <--- ERROR
- Switch to tab UIViewControllerB or C and back again -> UIViewControllerA is shown correct
My UIStructure is
UITabBarController
|-UINavigationController
| --UIViewControllerA Tab
| --UIViewControllerA0
| --UIViewControllerA1
|
|--UINavigationController
| --UIViewControllerB Tab
| --UIViewControllerB0
| --UIViewControllerB1
|
|--UINavigationController
| --UIViewControllerC Tab
| --UIViewControllerC0
| --UIViewControllerC1
|
I have tried several presentationStyles, but I need to show the Tabbar when presenting a "ChildViewController". I also tried to reload the ViewController somehow, but failed and I think this is not the right approach.
Is there a solution for this or is it just not possible to use a TabNavigation like this?
kind regards