Using a UISegmentedControl to switch UIViewControllers while using the same toolbar - objective-c

I have seen some questions asking about switching view controllers using a segmented control, but none of the suggestions seem to fit my needs.
I have a tab bar application with 3 tabs. The first tab is a navigation controller with a tableview as its root. When one of the rows is selected, I push a view controller X onto the navigation stack.
In controller X, I wish to use the segmented control to be placed in the bottom toolbar (as opposed to the titleview in many samples). Controller A would be shown inside controller X if the first segment is selected, controller B would be shown if the second segment is selected, whilst keeping the toolbar to be the same for A and B. What's the best approach to this problem?
Thanks,
Joe

Related

Navigation bar doesn't show back button

I have a navigation controller with a table full of buttons that cause various settings pages to push in. I needed to add a new one, so I copied one of my existing ones, changed the VC, and off I go.
But there's no nav bar on the screen. I can see the navigation object in the storyboard and the editor simulates it's display. I compared it to the other pages that are displaying the bar, and they look the same.
I tried changing some settings, like "Hide Bottom Bar On Push" and that had an effect, but my attempts to get the bar to show up fail.
I looked at other questions that suggested it had something to do with naming, but I've tried various name fields - on the Navigation Item, the VC's Title, etc. - with no effect.
I am not sure, but the problem may be that in case the segue to the new View Controller Scene is set to modal, it would not have a Nav Bar, To be able to see one, you need to embed that in another Navigation Controller.

Replace both SplitView screens with one ViewController screen

I can't seem to find this navigation use case for iPad SplitViewController. Using Storyboard, I have created a SplitViewController that shows Master/Detail and it works great. From my detail view, I want to have a button that completely replaces the entire SplitViewController (both master and detail screens) with a single ViewController.
Ideally, this would be a navigation that would allow back button function to return to the SplitViewController but I'm open to other solutions as long as the ViewController is using the full screen (I need every piece of screen real estate possible - and it will have popovers if that is of any consequence to the solution).
I assume this is possible and sure I'm not the first that needs to do this but I've searched quite a bit and found similar use cases, but not exact.
Here's my current layout in Storyboard:
TabBarView
SplitView A
Navigation
Master
Navigation > TableView
Detail
SplitView B
Navigation
Master
Navigation > TableView
Detail
Full Screen ViewController (where does this go in the above structure?)
So I need SplitView B to Navigate to the Full Screen ViewController that is not yet integrated into this screen navigation tree because I don't know where or how it would be placed in this structure.
Any suggestions on how to setup my Storyboard and/or use custom code to implement? I have tried man different ways to wire this but keep coming up short of what I need.

Storyboard with multiple UITabBarControllers

I have the following storyboard setup:
I would expect, that the two UITabBarControllers (blue and red) connecter to the orange UINavigationController and each display the different view controller and the "shared" one. However when running the app only one of the UITabBarControllers (the red one) has both view controllers. The other UITabBarController (blue) only has one item in the tab bar, which is not the orange one.
I have given all the different view controllers unique ID's but it doesn't change anything.
I could just duplicate the orange view controller but that would sort of be inconvenient, as everything is the same and it would clutter the storyboard.
Is there a way to accomplish the desired result with out cloning the orange view controller (ie. through code somehow)?
I will list the steps as we just started a new project:
Here, we have only the starting view controller.
select it, click Editor on menu bar Embed in navigator controller.
add a view controller from the right-bottom window.
embed in with the new view controller, two tab bars.
connect the starting view controller with both of the tab bars with a push segues(using buttons).
customise both of the tab bars.
test by clicking the two buttons.
I hope this is clear and helpful.
This happened in the design time the later connected tab bar replaces some property of the previously connected tab bar. I don't think this can be fixed (at least the way we are doing it). if that property could be set to both tab bars the interface builder would do it for us. I don't think that could be solved.

Shrink detail view controller animated when menu slides at UISplitViewController

I'm working with UISplitViewController on iPad and want to override it's behavior. When user taps on bar button, there are slides menu from the left side of screen. But it overlaps detail view controller. Can I make it so the detail view controller shrinks animated when the menu appears and expands when the menu disappears?
I don't think it's natively possible, so I think of 2 ways of doing this
1 - try and error: study the split delegate calls to see when you should shrink the content in your detail and tune it up until it looks smooth
2 - create your own "split" controller and do all the resizing/presenting by yourself

Question on Popover

In my app I have a navigation back button which occupies the top left of the navigation bar as such. Now I have a requirement to make the view in the navigation stack a split view. I'm doing my own custom split view controller. Now the question arises in the portrait mode of this split view. I want it to have the default popover behavior in portrait mode (like Apple's splitview in portrait). Can I manually set the location for the popover button on the navigation bar to some place other than top left without violating any UI guidelines? Since the back button is on top left corner by default already. I read over the UI guidelines but could not find anything concrete relating to this issue. Can the popover button be placed anywhere on the navigation bar for the portrait mode of my custom split view?
Thanks!
Yes, it can be done. As you said, there is no strict rule over placement of the pop-over in portrait mode.
This app uses custom split view and the placement of the button to display the navigator (inside a popover) in portrait mode varies on what view controller it is currently displaying. Whether it is the root of the navigation or if it is the view controller pushed over the navigation controller.