0

I am trying to do the following

UISplitViewController in portrait on iPhone shows detail VC instead of master

Open UISplitViewController to Master View rather than Detail

They all revolve around the delegate method collapseSecondary secondaryViewController:UIViewController, onto primaryViewController:UIViewController

I've been subclassing, moving classes, delegates etc for 4 hours now. This method won't get called. Hooked it up to an actual iPad in case it's a simulator problem. I now even ran the sample Master Detail project and it also doesn't call this method

What are you supposed to do to get this method triggered? When it won't even execute in the standard template project where you'd expect to have the delegate etc. set up correctly?

Steps to reproduce:

  • File > New > Project
  • Master-Detail App
  • In AppDelegate.swift search for collapseSecondary secondaryViewController
  • Make it end in ... -> Bool { print("CALLED"); return true}
  • Wait 2 years for this to finally print because it won't.

Please help me I am so frustrated with this. Setting this up in Android took me 3 minutes but for iOS being so special and everything I probably need to request for a written permission to unlock this "feature" for me.

M Reza
  • 18,350
  • 14
  • 66
  • 71
user2875404
  • 3,048
  • 3
  • 25
  • 47

1 Answers1

0

On the iPad, enter multi-tasking by dragging an app from the dock onto the right side, then drag the splitter line over to the left. Now your app is in horizontal compact and collapseSecondary will be called.

malhal
  • 26,330
  • 7
  • 115
  • 133