UIPageViewController ios5 & ios6 - ios

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?

Related

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.

Status bar rotates but application does not, on iPhone- works fine on iPad?

Long time lurker, always tried very hard to search and have found many answers this way. This is the first time I have found nothing that fixes my problem. This is also my first solo app, as I am a new developer.
I have two devices- an iOS 8.1 iPhone 6, and an iOS 7 iPad Mini Retina 2.
I am building my first iOS app. It uses storyboards for a UITabBarController with three tabs, each of which contains a UINavigationController and a custom sub view controller (such as a subclass of tabbarcontroller or collectionviewcontroller).
Under Deployment Info:
Deployment Target is set to 7.0 and Universal. iPhone and iPad both use the MainStoryboard main interface, with all four Device Orientations checked for both.
My AppDelegate starts with:
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:#"MainStoryboard" bundle:[NSBundle mainBundle]];
UITabBarController *initViewController = (UITabBarController *)[storyboard instantiateViewControllerWithIdentifier:#"rootTabBarController"];
NSLog(#"%d %d",initViewController.shouldAutorotate,initViewController.shouldAutomaticallyForwardRotationMethods);
[self.window setRootViewController:initViewController];
Note the NSLog; it prints "1 0".
So from what I can see- the tab bar should auto rotate.
On my iPhone, when I turn the device sideways, the status bar on the top rotates- but the content remains upright. If I hit the Home button and switch back to the app while holding it sideways, everything goes wonky- the content rotates but doesn't rearrange the layout, so it remains vertical, and thus gets cut off and there's a big black section on the side.
On my iPad, though- everything works fine! The application rotates as expected and resizes itself.
What am I doing wrong here? Thank you tremendously for any help.
Why are you programmatically loading the storyboard? If there's no specific need to do that, I'd suggest just using the template app delegate code. Better yet, create a completely new, fresh project and just copy over your storyboard. It won't necessarily make sense, but... I bet it will work!

dismissViewController doesn't dismiss presented view controller when using universal storyboard

I have discovered a situation that causes dismissViewController:animated:completion to not dismiss the view controller that has been presented. While it does dismiss on iPad running iOS 8, it doesn't dismiss on iPad running iOS 7.1. I've tried self, self.presentingViewController, and self.presentedViewController - all do nothing. I've tried it with Xcode 6.0 and 6.1 beta. While I do believe this is a bug, what can be done to work around it and force dismiss that view controller, ensuring it will work for iPad running iOS 7 and 8 (presented as a popover), and iPhone running iOS 7 and 8 (presented full screen)?
I have created a very simple project you may use to try this: Xcode project zip.
Project setup:
Universal storyboard targeted to iOS 7+
Implement Popover Presentation segue
Implement ability to dismiss popover inside that popover
To encounter the unexpected behavior:
Open the provided Xcode project
Run the app on iPad iOS 7 Simulator
Tap the top cell to present the popover
Tap the cell in the popover to dismiss it
The problem is in the way you try to handle the popover. To close the popover you should use the dismissPopoverAnimated method instead of dismissViewControllerAnimated.
I think you will have to make more work to complete your task for targeting both iOS versions. The root view controller should have some property to store the created popover with PoppedUpTVC as popover content and the PoppedUpTVC has to ask the root view controller to perform dismissPopoverAnimated method on the stored popover to close it.
To get a reference to the popover, try this in prepareForSegue:
if ([segue isKindOfClass:[UIStoryboardPopoverSegue class]]) {
UIStoryboardPopoverSegue *popoverSegue = (UIStoryboardPopoverSegue *)segue;
yourDestViewController.propertyToStorePopover = popoverSegue.popoverController;
}

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.

Strange behavior of Split View Controller in iOS5 and iOS6

I have a strange behavior of Split View Controller in iOS 5.0 and iOS 6.0 iPad simulators. I created Master View Detail template in Xcode and set deployment targets everywhere to 5.0. I switched Autolayout off and set orientation to landscape only.
My app works as follows - Split View Controller is my root VC and because I need to display login first I use
- (void)viewWillAppear:(BOOL)animated {
[self presentModalViewController:[self.storyboard instantiateViewControllerWithIdentifier:#"loginVC"] animated:NO];
}
in the MasterViewController. Everything runs smoothly on iOS 6 simulator, but the 5.0 just won't display the login VC and shows the rest in portrait mode, but turned to landscape. Picture attached below.
Anbody knows what could be wrong?

Resources