SplitViewController And PopOverController In DetailView - ios

I am super new to the iPad applications. I have a created a simple iPad app. MasterViewController with TableView embedded inside the UINavigationController. User taps one of the entries inside tableview that segues him to the WebViewController.
But after i implemented SplitViewController in Storyboard by telling it the Master and Detail View, the navigation bar on top of the detail view is disappeared. I have also implemented the SplitViewController that displays the master view controller on the left side in both portrait and landscape orientation but later removed it.
What I want is to show the masterview with tableview inside as it is with no splitviewcontroller, when user taps on one of the tableview entry, it segues to WebViewController (This is already happening till this point) but when the user reaches WebViewController, if he is in Landscape orientation, the tableview comes as a splitviewcontroller on the left side, if the user is in portrait mode, there should be a button on the navigation bar to show a popovercontroller having the same tableview entries and he can select any other entry without going back.
Can anyone help me how to implement this in Storyboards or guide me if i am doing the whole thing wrong. Thanks in advance.

Related

Programmatically push another view controller on top of a DetailViewController on a UISplitViewController

I am having some trouble using a UISplitViewController. I have a universal application where I have a UITabBar where in one Tab is a UISplitViewController. The Controller is (traditionally) collapsed on a phone and expanded on an iPad. The DetailViewController has a Button where another ViewController (a ChatViewController) is pushed on top of the detailViewController.
I want to do the following - I want to programmatically select the tab of the splitviewcontroller (no problem so far) and make the ChatViewController visible, i.e. on a phone push the DetailViewController on top of the MasterViewController and than the ChatViewController on top of the DetailViewController and on a Pad only push on the right hand side the ChatViewController on top of the DetailViewController.
I am using TWMessageBarManager to display within the App Push Notifications (i.e. Chat Messages in that case). When the user taps on the bar on the top I want to display the ChatViewController.
I am running in several problems:
After selecting the tab of the UISplitViewController I call a performSegueWithIdentifier to have the correct detailItem set and DetailViewController visible, before pushing the ChatViewController. However, the default behaviour is that the DetailViewController is pushed with an animation on top of the MasterViewController and I do not want that behaviour in this scenario.
The view hierarchy of a UISplitViewController is different on a tablet and phone and even during runtime. On a tablet (and on the phone, before the view controller was visible) the DetailViewController is in the splitviewcontroller.viewControllers array at the second position. On a phone, after the splitviewcontroller has shown the first time, the detailviewcontroller is in the masterviewcontroller.navigationcontroller.viewcontroller array.
Does anyone has a solution for not performing an animated segue within a SplitViewController (problem 1) and to get the correct reference of the detailViewController (problem 2.)
Best regards
Dominik

Maintaining popover across multiple detailviews in UISplitView

In my app delegate I create a UISplitViewController. I set the delegate to be the detailViewController.
When I run my app in portrait, I have the left top popover button showing that will slide out the split view master.
Then I have a button in my detail view that resets the splitviewcontroller array with a new detail view controller and sets the split view delegate to that controller.
The second detail view displays properly... but I lose my popover button on the second view controller.
Does anyone know how I can get that button to remain on all of my detail view controllers I may add?
Thanks!
See http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=1546 for what I find to be a good approach.
It involves setting the SplitViewController delegate to be the master instead of the detail. The master keeps references to the popoverController and the button, and each time the delegate methods are called (hide and show master) it gets the current detail view and performs the necessary action (add in the button/remove button and popovercontroller).
The master defines a protocol for "SubstituableDetailView" which contains the two methods for showing/hiding the button.

How to change SplitView to another view in UITabBarController as in Yelp iPad App

I want to created a view in UITabBarController as the iPad App shown (see image links below [1] [2]), where the default view is a split view and by clicking on "Photo", the split view is replaced as another view. And both views are displayed in the same tab item.
I am able to create split view within tab bar now, which means I can create something like what the first picture shows, but how to replace the split view with another view?
I have tried to assign the UISplitViewController with another UIViewController, but it doesn't work.
As I can't post images, here are the links:
http://ww3.sinaimg.cn/large/7811c8e9gw1dphto6x47wj.jpg [1]
http://ww3.sinaimg.cn/large/7811c8e9gw1dphtpj1ltaj.jpg [2]
I simply add a UINavigationController in front of the UISplitViewController(between the UITabBarController and the UISplitViewController). When the user toggles the UISegmentedControl, the fullscreen view you need will be pushed onto the UISplitViewController. Here is the storyboard. (But, I can`t paste any photo.)
To access the UINavigationController in the master view or detail view, you can use
[self.splitViewController.navigationController pushViewController:fullScreenViewController animated:YES];
.
Since you don`t want the navigation bar of the UINavigationController to appear in the splitView, you need to subclass the UISplitViewController. Then hide the navigation bar in the viewDidApplear:
You can refer to some questions like How to hide the master view or How to display the detail view in a full screen mode. You can also try this customized UISplitViewController MGSplitViewController, which can toggle the master view and detail view in any situation.

Moving a navigation stack to the more-tab

I have a UINavigationController on some tab of a UITabBar. When I drill down into the navigation controllers tableViews, move it into the more-tab, and then select the entry in the tableview in the more-list, i get the viewController that was visible at the time i left the tab i moved. Clicking on the back-button gets me back to the more-list, with no possibility to get back to the initial root view controller.
It would be perfectly okay for me to have the root view controller appear when i click on the item in the more-list, but i have no idea how to get notified when my viewcontroller is moved, since i am developing a library, and so have no reference to the TabBarController.
One of the ways is to implement tabBarController:willEndCustomizingViewControllers:changed: method in UITabBarViewController delegate. And watch for it. If such thing happend then reset you viewController and navigationViewController. This remove your UINavigationController stack, but application will work correctly.

Adding Navigation controller in DetailViewController ipad

Please tell me how i can do this. I am making an iPad app.I have a list in tableview of RootViewController , clicking on each of which displays a table having information in DetailViewController. By default there is a tab bar at the top of the DetailViewController but i want to add navigation controller over there.
Just push a new controller in your current navigation controller! No need for a new one.

Resources