1
votes

I have a UISplitViewController. In the detail panel I have a UIToolbar at the bottom. One of the BarButtonItems launches a UIPopoverController via a performSegue method.

The popover's child view controller returns YES in its modalInPopover method. Tapping outside of the popover does not close it, but tapping on any of the bar button items in the UIToolbar still performs the function of that bar button item even tho the popover is supposed to be "modal".

If I set NO for the modalInPopover, then clicks anywhere except for the bar button items will close the popover; however, tapping on the bar button items will still work and the popover will remain visible.

There are no passthru views set. I can't understand how these bar buttons are still working when the popover is visible. Any suggestions or insights would be welcomed.

1

1 Answers

1
votes

I've been having the exact same problem and really I couldn't find a clean way of doing it. What I can suggest is to in your prepareForSegue:sender: do disable the user interactions of the toolbar using this property of UIView userInteractionEnabled.

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Make sure your segue name in storyboard is the same as this line
    if ([[segue identifier] isEqualToString:@"YOUR_SEGUE_NAME_HERE"])
    {
        // disable user interaction on toolbar here
        self.navigationController.navigationBar.userInteractionEnabled = NO;
    }
}

I hope this helps.