iospopoverportraituisplitview

UISplitView: Dismiss another popover when splitview popover is presented


I have a problem on my iPad application using a UISplitView. Basically, I have another button which toggles a Popover (different from the basic splitview popover). An image might explain my problem better: enter image description here The problem is only there in Portrait mode.

There are 2 cases possible:

Do you know how I could handle the touch event on the default "Folders" button offered by the splitview?


Solution

  • Fixed it! There's a delegate method called by the splitview when its popover is going to present a view controller, here it is:

    //-------------------------------------------------------------------------------------
    // splitViewController:popoverController:willPresentViewController:
    //-------------------------------------------------------------------------------------
    - (void)splitViewController:(UISplitViewController *)svc
             popoverController:(UIPopoverController *)pc
     willPresentViewController:(UIViewController *)aViewController
    {
        [self.popoverSettings dismissPopoverAnimated:YES]; //dismiss the other popover here
    }
    

    Apple's documentation here