We have a universal app with Split view controllers which are embedded within the different tabs. We're observing that on iOS 13 on iPhone, and while switching tabs, the detail view is showed instead of the master view occasionally. We have not been able to single out the pattern and this just happens randomly, but frequently.
I have already referred to UISplitViewController in portrait on iPhone shows detail VC instead of master and Open UISplitViewController to Master View rather than Detail and we're implementing the delegate for SplitViewController. This delegate also gets called.
class AppSplitViewController: UISplitViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.delegate = self
self.preferredDisplayMode = .allVisible
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destination.
// Pass the selected object to the new view controller.
}
*/
}
// MARK: - UISplitViewControllerDelegate Methods
extension AppSplitViewController: UISplitViewControllerDelegate {
func splitViewController(_ splitViewController: UISplitViewController, collapseSecondary secondaryViewController: UIViewController, onto primaryViewController: UIViewController) -> Bool {
return true
}
}
I am not sure if other people have observed this on iOS 13 as well or not, but I am not sure why iOS would present detail view occasionally even though we have the proper delegate implementation. Please note that we have not been able to reproduce this on iOS 12. Here is view stack https://i.stack.imgur.com/YrcKL.jpg