I'm running on Mt Lion with Xcode 4.5.1 installed.
By default, when I build and deploy to a iOS 5.1 device, the display would rotate when I rotate the device but it doesn't seems to work when I deploy to either the iOS 6 simulator or my iPad or iPhone running iOS 6.
Is there something I'm missing here?
Please read the following, hope it help. (referencehttp://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html)
Handling View Rotations
In iOS 6, your app supports the interface orientations defined in your app’s Info.plist file. A view controller can override the supportedInterfaceOrientations method to limit the list of supported orientations. Generally, the system calls this method only on the root view controller of the window or a view controller presented to fill the entire screen; child view controllers use the portion of the window provided for them by their parent view controller and no longer participate in directly in decisions about what rotations are supported. The intersection of the app’s orientation mask and the view controller’s orientation mask is used to determine which orientations a view controller can be rotated into.
You can override the preferredInterfaceOrientationForPresentation for a view controller that is intended to be presented full screen in a specific orientation.
In iOS 5 and earlier, the UIViewController class displays views in portrait mode only. To support additional orientations, you must override the shouldAutorotateToInterfaceOrientation: method and return YES for any orientations your subclass supports. If the autoresizing properties of your views are configured correctly, that may be all you have to do. However, the UIViewController class provides additional hooks for you to implement additional behaviors as needed. Generally, if your view controller is intended to be used as a child view controller, it should support all interface orientations.
and this link may be helpful for you http://www.cocos2d-iphone.org/forum/topic/40721
there are some interesting comment from the link above -> Try to override the shouldAutoRotate method on the rvc, and put the conditional there. As far as I have tested, the shouldAutoRotateToInterfaceOrientation isn't called on iOS6 even with all fixes applied, so I was forced to override several more methods.
please give me a feedback, thanks :)
Related
I try to build a simple app based on the UISplitViewController template from Xcode 6 for universal apps (with Storyboard and CoreData/NSFetchedResultsController). This app should also provide a search bar for the MasterViewController. Unfortunately, Xcode 6 provides no InterfaceBuilder element for the UISearchBar/UISearchController combo (only the depreciated UISearchBar/UISearchDisplayController).
In the iOS Developer library, Apple provides the "Table Search with UISearchController" example, but this is not based on the UISplitViewController and supports only iPhone.
My problem is, that I'm not able to show the detail view on the correct ViewController under all circumstances. I tried to transfer the approach from the Apple example project to the UISplitViewController template. In this, one is encouraged to show the search results in a separate UITableViewController subclass (ResultsTableViewController) and use this as the searchResultsController of the UISearchController. I was not able to create a scene in InterfaceBuilder for this setup so I had to add these manually in code.
The problems begin when I click on a table cell of the ResultsTableViewController. This vc is not part of the scene in InterfaceBuilde and I don't know how to add it to the SplitViewController setting correctly. The biggest problem is the weird behavoir of the iPhone 6 Plus and the UISplitViewController. In portrait mode it behaves like an iPhone and doesn't seem to have a SplitViewController and only uses a NavigationController to which I push my DetailViewController. In landscape mode it behaves like an iPad with SplitViewController were I have to get the second ViewController of the SplitViewController childControllers and push the DetailViewController on this one.
Now it happens, when I start in portrait mode and switch to landscape mode that the DetailViewController is all gone, showing gray space where the DetailVC should be. It seems, when going to portrait mode, the DetailViewController gets kicked from the SplitViewController (or the SplitViewController gets kicked at all in favor for the iPhones NavigationController setup). When switching back to landscape the SplitViewController is initialized again but without proper initialization of the DetailViewController.
Is there any template or suggestion on how to correctly implement search capabilities on a universal UISplitViewController?
Cheers
Björn
I am trying to work with Xcode 6.1. How can I use different storyboards for iPhone and iPad in Xcode 6.1? I mean, I want to create two different storyboards for iPhone and iPad, and the app will determine which storyboard is to be presented when launching.
I know that I can turn "Use Size Classes"(in the settings of a storyboard file) off to make a storyboard for only iPhone or iPad. But "Main Interface" in the target settings can be only one storyboard. So I don't know how to do.
My favorite feature of Xcode 6 so far is the new size classes concept in Interface Builder.
They also enable the condensing of universal apps into one storyboard file.
Combined with the new adaptive view controllers, it's easier then ever to rely on interface builder, rather than fight with it, to simplify the creation of your app layouts. Every view controller in your app gets a trait collection object.
This trait collection object has 2 size classes, a horizontal size class and a vertical size class. And each of these classes has 3 possible values: compact, regular, or any. These values can change based on the device and its orientation.
Your app will layout its interface for each view controller based on the current size classes. Apple uses a grid to let the user choose which configuration to work in, so here's that same grid but with each device+orientation highlighted in its corresponding size class combo.
Kindly refer the Link
In my app I want one view controller to be shown in landscape because it is a signature pad. The rest of the views are portrait. I can force the view to be landscape without a problem as long as it is not embedded in a Navigation Controller. The problem is that I want the Navigation bar to show also. Does anyone know a workaround for this?
You can either present your view controller instead of push using UINavigationController (See kjam's solution in the following link) or you may try this solution of arpan_techisavy.
I'm dealing with an iPad project that manages a custom menu and a subview with different stuff on in it, now i want to try to put on this subview a splitview. Is it possible? How can I do it? How can I build my splitview without any template?
The Apple human interface guidelines forbid this and say that the UISplitViewController must be installed as the Root View Controller so it would be best to redesign your app with this in mind since they will not approve it when submitted for review otherwise.
Whilst this is an old question it's still worth adding that Apple seem to have relaxed their rules. I have had a couple of apps approved that have a SplitView inside a TabBar.
Usually I've used NSNavigationController to switch between different view controllers smoothly. Now, on the iPad, I need a way to switch between view controllers, but am at a loss, since it seems that I cannot start a UINavigationController iPad app from Xcode. The only substitute I've found is SplitViewController -- I don't wish to display my app in this manner. In short, all I need is:
NEED: A way to smoothly transition (Switch) between UIViewControllers (the views therof?) from my application delegate.
The templates are just starting points to make initial configuration easier. You can just as easily start with the View- or Window-based Application template and then reconfigure it however you like.
Though keep in mind that Apple has not made iPad an option on the Navigation-based Application template for a reason (transitioning the entire window in an iPad is discouraged in the user interface guidelines).