title: Split View controller occasionally showing detail view on iPhone on iOS 13
body: <p>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. </p>
  
  <p>I have already referred to <a href="https://stackoverflow.com/questions/25875618/uisplitviewcontroller-in-portrait-on-iphone-shows-detail-vc-instead-of-master">UISplitViewController in portrait on iPhone shows detail VC instead of master</a> and 
  <a href="https://stackoverflow.com/questions/29506713/open-uisplitviewcontroller-to-master-view-rather-than-detail">Open UISplitViewController to Master View rather than Detail</a> and we're implementing the delegate for SplitViewController. This delegate also gets called. </p>
  
  <pre><code>
  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) -&gt; Bool {
          return true
      }
  }
  </code></pre>
  
  <p>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 
   <a href="https://imgur.com/eWO3RQM" rel="nofollow noreferrer">https://imgur.com/eWO3RQM</a></p>