I have a Swift Tab Bar with 3 Bar Items which lead to 3 different ViewControllers, A, B and C. I'm not using any NavigationControllers. A leads to A1 ViewController via :
self.definesPresentationContext = true
A1viewcontroller.modalPresentationStyle = .overCurrentContext
self.present(A1viewcontroller, animated: true, completion: nil)
And the A1 has a Back button that dismisses itself to return to A via:
self.dismiss(animated: true, completion: nil)
My problem is that if I click through to show A1 from A, then click on the Tab Bar Item for B, then go back to the A Tab Bar Item which shows me A1 where I left off and I click on the Back button I get a black screen where I would have expected to go back to the presenting viewcontroller A. If I then click back again to B, then back to the A Tab Bar Item I see A which is as if the A1 viewcontroller did get dismissed.
So when I'm on A1 why does going to B mess up the Back button action when I return to A and send me to a black screen?
By the way, I have read through: modal View controllers - how to display and dismiss