SplitView for ipad and menu drawer for iPhone - ios

Im developing one Universal app (for iPhone and iPad both).
Following is the requirement of app .
Requirement
1.There should be a menu (master on the left) and detail (on the right).
2.For iPhone menu or masterViewController should be on drawer or on slide out menu.
3.For iPad menu should be on rootViewController of splitView.
i have already tried
I tried to implement it using spiltViewController, for iPad it is working fine (MasterViewController is coming on left of the screen and DetailViewController is on right side of the screen ) but for iPhone it is simply working as UINavigationController (MasterViewController controller as rootViewController of UINavigationController).
what approach should i use to implement it?

Since iOS8 you can use UISplitViewController for this purpose.
The solution starts at 14:00 aprox in this WWDC 2014 video:
View Controller Advancements in iOS8
More info at:
http://coding.tabasoft.it/ios/the-new-uisplitviewcontroller/

Related

Delay in navigation while using SWRevealViewController in Simulator

I am using SWRevealViewController in Objective-C for drawing side navigation menu. It works fine on real device, but when I test the application in simulator, transitions among the screens from side menu are very slow. It takes more than 10 seconds to go to another screen from navigation menu. Has anyone faced this issue before?

How to enable UISplitViewController's preferredDisplayMode = .primaryOverlay setting for iPhone size class

I am trying to use the UISplitViewController for iPhone portrait mode (since it will use navigation controller instead).
I tried to set the UISplitViewController's preferredDisplayMode = .primaryOverlay (which let user to swipe in/out master view from the left). However, this setting only works for iPad and Plus. iPhone still keep using navigation controller, ignoring my setting.
My question is - how to use UISplitViewController for iPhone? I see that Outlook iOS app can do this so it should be possible.
Thanks.
The UISplitViewController only works on iPads. On iPhone it acts like a master/detail view controller. If you want that UI style for iPhone you'll have to implement it yourself.

View Controller is not in window hierarchy issue?

I use storyboards, no navigation bar or tab bar. I'm using 2 view controllers and 2 storyboards for my app. ViewController has intro of game and ViewControllerTWO has actual game. I'm using ViewController and ViewControllerTWO for iPhone 4s and iPhone 5,5s.
ONLY when I load the iPhone 4s simulator, in the Debug Area, Xcode tells me "Warning: Attempt to present "GKHostedAuthenticateViewController: 0x8989e7e0 on ViewControllerTWO: 0x78974xc0 whose view is not in the window hierarchy!"
Also, when I plug in my iPhone 4s device, I don't get this message, it only gets this message when i'm using simulator for iPhone4s.
What does this mean? What's Xcode want with ViewControllerTWO?
Try to perform your segue in -viewDidAppear:. The view controller can't present anything before its loaded into the main window.

iOS 8 Screen slides wrong direction when back button tapped

My application was written for iOS7 and I am trying to get it updated to iOS 8. My application is configured to only work in Landscape Left and Landscape Right orientations.
For iOS 8 I changed the order by which the screens are navigated and changed one of the modal screens to a push transition. On the main screen I have two UIBarButtonItems on the UINavigationItem. Each of these have a push segue assigned to them that connects to different screens.
When the app is running and one of the UIBarButtonItems is tapped, the screen associated through the segue slides over the main screen as expected. The back button is displayed normally. The problem occurs when the back button is tapped. The screen does not slide off to the right as would be expected.
On an iPhone 4 running iOS 7 the screen always slides down (towards the ground) regardless of the devices landscape left or landscape right orientation.
On an iPhone 6 Plus running iOS 8 the called screen quickly rotates to Upside Down (top towards the home button) and then slides off to home button side. Again it doesn't matter which way the phone is oriented landscape left or landscape right orientation.
I have tried setting the preferredInterfaceOrientationForPresentation, shouldAutorotate to NO, and setting the supportedInterfaceOrientations to UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeRight. Nothing seems to make any difference at all.
My screen navigation is straight forward, I'm no using any custom transitions. It's all through standard push segues.
I need to get the screen "back" transitions working correctly again.
Any help is greatly appreciated!
I have finally discovered what was causing my screens to slide the wrong direction. It turns out that overriding the supportedInterfaceOrientations method in the UIViewController and returning UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft confuses the transition in iOS 8 (and devices running iOS 7 also). This was needed for proper operation in iOS 7, but evidently causes problems in iOS 8. So once I removed the code, the screen transitions began working correctly again.

UIPageViewController ios5 & ios6

I have a navigation controller that has a UIViewController pushed onto it (VC0).
This VC0 has a pageViewController (PVC) property that uses either one (VC1) or two (VC1 & VC2) "page slide" viewControllers dependant upon portrait or landscape device orientation.
This all seems to work fine in iOS6. In iOS 5 almost everything is fine too.
However, the problem I am having in iOS5 is if the device is landscape and the app opened when VC0 is pushed and PVC created, spineLocationForInterfaceOrientation is not being called :(
It does get called in iOS6.
Has anyone else come across this and found a work around?

Resources