iOS 5 Storyboard Orientation does not work - ios

We have an app we are designing using iOS 5 storyboards (Xcode 4.4, Mountain Lion) with a tab view controller and we're trying to add a split view controller as a third tab.
Prior to adding the Split View Controller, we set all the view controllers to landscape orientation in the simulated metrics section of the storyboard editor. Worked fine. Added the Split View Controller, changed its orientation to landscape, and the first tab (not the split view) now draws all the UI elements as if it's portrait when we run it in the simulator. The simulator defaults to landscape, but the UI is sideways as if it was portrait, with most of it hidden (because it's designed to be landscape).
We deleted the Split View Controller and the problem persists.
Any ideas? We've cleaned, re-built, quit Xcode, re-run, etc. There has not been one stitch of code added yet, as we are simply trying to build the UI appearance before writing code to back it up, and we're at the very early stages.
Thanks.
Andrew

See my answer here for the steps to make sure you have a landscape oriented app all around.
When I click the back button my view changes from landscape to portrait
Also Split View Controllers have to be the rootViewController. Adding them as a tab inside a TabViewController won't work out of the box.

Related

UISplitViewController in UITabBarController - SplitView Navigation Bar Glitch / Bug or me doing something wrong?

QUESTIONS AT THE END OF THE POST
PROBLEM: I discovered a strange behavior of UISplitViewController when embedding it in a UITabBarController. The setup is quiet simple and can be reproduced without any coding. Create a StoryBoard based app and drag a UITabBarController onto the StoryBoard and make it the initial view controller. Then drag a UISplitViewController onto the board and make it an item of the UITabBarController. Embed the UISplitViewControllers detail view controller in a UINavigationController as well. Finally, set the background color of the master and detail view controllers to something noticeable.
The StoryBoard should look like this:
Step 1: Run the application on an device which can show master and detail at the same time (e. g. iPad or big screen iPhone). You should notice that the master is not extending under the bars and instead, the background of UISplitViewController shines through.
Step 2: Rotate the screen to portrait so the master gets collapsed. Swipe in from the side to reveal the master. At this point, both navigation bars are showing the correct background color.
Step 3: Rotate the screen back to landscape. Now the detail has the background of the UISplitViewController and the master is showing the correct color.
FINDINGS:
On start, the tableview of the master is not extending under the navigation bar.
When and only if revealing the master in portrait mode and then rotating back, the glich changes so that now the master extends under the bars and the detail does not anymore.
If not revealing the master in portrait, you can rotate as many times as you want without changing the behavior
It only happens on devices which can show master and detail at the same time
It only happens when embedding a UISplitViewController in a UITabBarController
QUESTIONS:
Why are master and detail not expanding correctly under their navigation bar?
Why does this only happen on iPad/iPhone Plus and not on regular iPhones (there everything works exactly as expected)?
Is there any fix I could apply to make this work on iPad?
Is there a better design approach than having a TabBar with a master-detail flow embedded? For me a TabBar just seems right to switch between different types of content in my app and I don't want to have a full width tableview on iPads. The SplitViewController also seems to be the right approach to display my content...
5 Month later there is still no solution for this. Moreover, as I was stumbling across this issue once again while developing another app, I found this old post from 2015 having the same issue: Navigation bar for split view controller is darker when inside a tab bar controller
So I guess Apple has no intention on fixing their own controllers and we developers are screwed. The only way we can have a UITabBar at the bottom while showing a UISplitViewController above with proper translucent UINavigationBars is to implement our own container view controllers.
I finally solved the issue by using a plain UIViewController with a UITabBar pinned to the bottom while using the UIViewController containment API to show/hide my UISplitViewControllers.

UIViewControllerTransitioningDelegate to display a pop up screen on top of a UITableViewController

I have used a UIViewControllerTransitioningDelegate to display another ViewController on top of a UITableViewController.
This helped avoid replacing existing UITableViewController(s) with a view controller + table (or hacking the combined component to display a view that does not scroll with the table on top of the table).
This was working fine until I tried adding didSelectRow on the Table object. Although the (pop up) view controller works ok, when dismissed, the following issues started (all associated with the navigation controller):
toolbar - I have a tool bar on screen (always shown). On dismissing the (pop up) view controller, the toolbar changes status to 'hidden' (setting 'hidden' to false brought it back).
on screen (floating) buttons (owned by the nav controller) - if these were displayed, they now 'disappear'. Checking the x, y coordinates, showed that their position has not changed but it looks as if they've been pushed backward from a view layering perspective).
Any ideas? Has anyone encountered this behaviour?
tested on the following devices: 4s, 5, 6/6p, 6s/6sp.
All devices showed the same issue except iPhone 6 (1st gen).
Tested with ios versions 9.2, 9.2.1, 9.3, 9.3.1.
The issues were caused as a result of displaying the view using the 'current'/presenting VC as oppose to presenting via the navigation controller. Once changed, it all worked as expected.

UISplitViewController on iPad: stopping Master view to appear when touching on detail view

I created a Master/DetailView project on iOS for iPad. I set portrait mode only and I got my app running. In the detail view I added a UITableView with some customised cells (iOS settings style).
Fig. below: iOS settings menu. In my case when touching the margins of the UISlider in the brightness group I would some times summon the master view (which in my project I would like to disappear - differently from the settings menu of iOS).
However I got a little problem.. sometimes when I touch the margins of the cell the master view will appear and the action that I was doing in the cell gets void. Any idea on how I can stop the master view to be summoned by the detail view when the user touches the borders of the detail viewstrong text?
Try setting presentsWithGesture to false for your UISplitViewController.

View Controller in the "More" tab doesn't rotate, but it will if it's on the home row.

I have an app built in storyboard that needs to support landscape mode in just one view controller. I decided to support iOS 6 after some issues with supporting iOS 5 and running iOS 6 on my phone. I used this Stack Overflow answer: https://stackoverflow.com/a/12505461/1050388 but I'm still seeing a weird quirk. (For those interested, my controller scheme is Tab Controller -> Navigation Controller -> TableViewController -> UIWebView. The UIWebView is the only VC I need to rotate.)
I blocked all but one VC from turning, but that VC is in the "More" tab. I initially had a quirk where this "More" VC would change orientation to landscape when rotated and then any subsequent VC would be in landscape, but I found this (https://stackoverflow.com/a/12526152/1050388) and creating a category for UINavigationController helped to solve that issue.
However, when I navigate to that tab in the "More" list, and turn the VC, it doesn't rotate. But when I click "Edit" and move that tab to the home row of the initial 4 tabs, it rotates just fine. If I move it back, it doesn't rotate. Anyone have an idea why this is happening?
I believe the problem stems from the fact that the More navigation controller is generated dynamically by iOS and is read-only.
http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UITabBarController_Class/Reference/Reference.html#//apple_ref/occ/instp/UITabBarController/moreNavigationController
It would be great if the technique of using a custom category would work here but based on your experience I guess it doesn't.
I also need better control of orientations for More tab views. Please post anything you come up with. Thanks.

Ipad orientation problem when a splitview is brought in

I have an application in which my first view has a label and a button..when I click the button, I bring in a split view.
The problem I am facing is that, the orientation of the split view is acting wierd. At times, it displays in landscape orientation properly and at other times, it displays in portrait orientation with half of its view cut. During this time, when I change the ipad orientations using the cmd + arrow keys, the split view goes haphazard.
I have included in my info.plist file -> Information property list " Initial interface orientation" and its value " landscape (right home button)". Other than that, I have not made any change...
The main thing which is bugging me is that, this does not happen all the time. It happens off and on.
It would be great if someone could help me out in this.
If you check the docs, I think it says that the split view should be the root view of the application. Not complying with this will likely cause 'buggy' behaviour.
If Jack is right, you should let the split view be the root view and just display your first view above it. When the button is tapped you dismiss the first view and the root view/split view will be visible.

Resources