Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blank master view after rotate #97

Open
Kalibur opened this issue Nov 17, 2014 · 1 comment
Open

Blank master view after rotate #97

Kalibur opened this issue Nov 17, 2014 · 1 comment

Comments

@Kalibur
Copy link

Kalibur commented Nov 17, 2014

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.

@thiagorios
Copy link

woow thx a lot! U saved my day!

This solution should be in the main project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants