Question on Popover - cocoa-touch

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.

Related

Navigation bar blends with black instead of white when presenting a view controller modally

I'm trying to present a view controller (which is embedded in a navigation controller) modally. The problem is that when the view is presented, it is blending the navigation bar with black rather than white.
I am creating my view controller from a storyboard and showing it by using -[UIViewController presentViewController:animated:completion:].
How can I get the correct blending as can be seen below?
Incorrect behavior:
Correct behavior:
The problem was that the Extend Edges setting had Under Top Bars disabled. Once I enabled that setting, everything worked properly.
Note to revert to the defaults, you should enable Under Top Bars and Under Bottom Bars. The latter is especially useful if you notice the same behavior with a tool bar at the bottom of the view controller.
You can see what the value is set to programmatically by reading the edgesForExtendedLayout value on your view controller. If it is set to UIRectEdgeNone, you will get the undesirable behavior.
For more information on how extended edges works, see this answer.

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.

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

Putting a toolbar directly under a navigation controller without hiding the content underneath the toolbar

I am trying to put a toolbar directly beneath a navigation bar but I need the toolbar to not hide the content from the view directly beneath it. My quick solution was to set the navigation controller's native toolbar to visible, which works and properly resizes the view beneath it so that it doesn't let anything hide behind it, BUT the default toolbar shows at the bottom of the screen.
I need it to be at the top, just under the nav bar. I figure the easy solution would be to change the frame of the default toolbar (which I don't know how to do) OR to position a new instance of the toolbar onto the view (which works but it hides the content beneath it) but have it resize the views below.
Please see the following image that I found to see what I'm trying to do. (note how the tableview's first row starts UNDER the tab bar)
Thanks!!!
You are confusing two things. The NavigationController toolbar property IS the bottom bar, any toolbar that you add to a view has nothing to do with the nav controller but is a property of that view.
If you have your own toolbar at the top of a view you need to move the rest of the view content down or set that toolbar to translucent if thats what your looking for.
Again the nav controller toolbar is always the bottom bar, the toolbar you drop in IB is just a toolbar for that view that you can put anywhere.
I don't believe you can change the frame of the default toolbar. You will need to create your own instance of a toolbar, position it at the bottom of the navigation bar and resize your tableView to fit below.
We can't see how you have your views set up but if you are starting with a view that is subclassed as UITableViewController you will have trouble doing that. What you want is to start with a UIViewController as your master controller, add a tableview and toolbar as subviews. Then position and size them as appropriate.
If you are hiding and showing the toolbar you will create a method to move it up under the navigation controller and again resize the tableview.

Tabbar as main view (left side) of splitview controller

Just like the Dropbox app for iPad I want to add Tabbar in the main view controller of splitview.. wondering what is the best way to achieve this?
Checkout the screen grab of ipad dropbox app... I am referring to the tabbar used on bottom left.
Select the Navigation Controller of your Split View Controller in Xcode and in the properties panel it will give you checkboxes to enable/disable top navigation bar and bottom toolbar for it (Dropbox app in your screenshot have both, so you should check both of them if you need the same layout).