Good morning. I know how to integrate split view in my project. I started with window based application, and would now like to touch a button and you see a splitview. Thank you very much.
Asked
Active
Viewed 235 times
1
-
I've had to do this in the past: see my old question here: http://stackoverflow.com/questions/4213097/best-way-to-switch-between-uisplitviewcontroller-and-other-view-controllers – occulus Nov 18 '11 at 17:49
1 Answers
0
What you are asking for is a view controller with a view on at the root that has as it's view or as a child of it's view a uiButton. When pressed that uiButton would call a method that tells the appDelegate to remove the root view controller and create a new one that is a split view controller.

ader
- 5,403
- 1
- 21
- 26
-
Not a good idea. Apple specify that the split view controller has to be the root controller at all times during your apps lifetime; if you ignore this, things can go crazy. More details here: http://stackoverflow.com/questions/4213097/best-way-to-switch-between-uisplitviewcontroller-and-other-view-controllers – occulus Nov 18 '11 at 17:52
-
I still disagree. I can't see a problem with using a uiviewcontroller and then removing it and programmatically adding a splitviewcontroller as the root view controller and not removing it. In that scenario the splitviewcontroller is the root view controller (when it exists) and is not removed. Can you post any links to Apple commentary to support your assertion that we shouldn't do this? – ader Nov 22 '11 at 09:28
-
1Ade, I can't find an Apple doc reference which says that the UISplitViewController has to *always* be the root VC during the lifetime of the app. However, my experience and that of others seems to show that if you violate this, be prepared for problems and having to write workarounds etc. See for example http://stackoverflow.com/questions/2640225/uisplitviewcontroller-and-complex-view-hierarchy. Personally, having been through this myself, I'd be very wary about trying to switch a UISplitViewController in and out as the main root VC under UIWindow. – occulus Nov 24 '11 at 08:58
-
Thanks for looking further :) I agree about switching in and out, I was just suggesting switching a splitviewcontroller in once only might be an option. I also agree/think your initial link to using a modal inside the splitviewcontroller (which is at root from the start) is the better way to go if possible. – ader Nov 24 '11 at 10:25