Skip to content

Blank master view after rotate #97

@Kalibur

Description

@Kalibur

There were a ton of issues on iOS 8 and most were fixed by this fork: https://github.com/asprega/MGSplitViewController

I did find an issue though. In portrait mode, if you had the master view open in the popover and rotated the device (in my case an iPad 2 running iOS 8) the master view would be created and then immediately go blank. What I found was that the popover was not getting dismissed first.

To fix this, I needed to go into the MGSplitViewController.m and move the lines:

if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
    [_hiddenPopoverController dismissPopoverAnimated:NO];
} 

from

  • (void)willAnimateRotationToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

to the end of

  • (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration

So my solution looked like this:

  • (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
    {
    [self.masterViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
    [self.detailViewController willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];

    //This fixes the iOS 8 rotation bug when the popover is present
    if (_hiddenPopoverController && _hiddenPopoverController.popoverVisible) {
    [_hiddenPopoverController dismissPopoverAnimated:NO];
    }
    }

I was going to post this in the issue board for asprega's fork, but I could not find it. So hopefully this will help someone save a couple minutes of searching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions