official alternative to implement Splitview as a s

2019-08-24 22:54发布

问题:

I'm developing an app in IOS using Storyboard for the Ipad. I want to add UISplitViewController as a subview of my app. I want to generate this kind of output (see below image). when user click on FirstView's 'Next' button, a second view-splitview should appear.

Output:

But Apple's guidelines says that we can't push UISplitViewController as a subview of module. if we use a UISplitViewController, it has to be visible at all the times in our app. so

when i tried to add any splitviewcontroller directly into the storyboard, it generated the error .

Split View Controllers cannot be pushed to a Navigation Controller

I dig around the net but unfortunately couldn't find any proper help.

is there any official alternative to use such a kind of facility by Apple itself?

or any link to the working code or samples to implement such a kind of functionality. If i'm using third party solution, will my app get banned by Apple App store as they don't allow to do so?

I think this is a very basic kind of functionality which many people needs to implement in their app as a submodule. So there must be a inbuilt facility by apple. may b i don't know about it. any help would be greatly appreciated.

回答1:

This isn't an answer to your exact question, but may help in part.

I have an app that uses a UISplitViewController that is a subview of a UITabBarController.

This goes against Apple guidelines, but was desirable for my design that started originally as an iPhone app, and that I wanted to convert to a Universal app. I also wanted to maintain the UI convention of my app that the iPhone users were familiar with.

Unsurprisingly, there were problems with the notification of the orientation to the various UISplitViewControllers that weren't visible (though it would seem that Apple could support this if they chose to).

The workaround was to use the new API added in iOS 5.0,

splitViewController:shouldHideViewController:inOrientation:

...and always return NO. Not the ideal UI arrangement, but it works, and was accepted by Apple as an app update.

So, (clearly) you'll need to do this programmatically, rather than use Storyboards, but I think if you can get it working, Apple may approve. I wouldn't recommend you risk this if you can avoid it, however.