[iOS 9] UIPopoverPresentationController not disabling bar button items anymore

Using the following statements

  [navigationController setModalPresentationStyle:UIModalPresentationPopover];
  [self presentViewController:navigationController animated:YES completion:nil];

  UIPopoverPresentationController* presentationController = [navigationController popoverPresentationController];

  [presentationController setBarButtonItem:sender];
  [presentationController setPassthroughViews:nil];
  [presentationController setPermittedArrowDirections:UIPopoverArrowDirectionAny];

the code does not disable other bar button items anymore (as before iOS 9). Especially when touching a bar button item while the popover is presented I get the following warning:


Warning: Attempt to present <UINavigationController: 0x7fcff393cc00> on <SLLoggingNavigationViewControllerClass: 0x7fcff18c9600> which is already presenting (null)


This happens in iOS 9 on an iPad. How do I get the old behaviour back? And how do I get rid of the warning?


Regards,

Hartwig

Replies

You can try

self.navigationController.navigationBarHidden = true;


but I'm not sure if it will work for all configurations. I tried to embed a CNContactViewController within a popover and the navigation bar is only hidden when the Contact form sheet appears. After 'creating' oder 'updating' the contact the navigation bar reappears ...


So far I couldn't find a solution how to hide the navigation bar permanently,


best regards

Karl

Hi Karl,


it is not about hiding the navigation bar but about disabling bar button elements.


Regards,
Hartwig