UIPopoverController is deprecated

So I am going through the book in Xcode 7 and iOS 9 and haven’t had major problems (mostly because of the help of this forum), but as of iOS 9, UIPopoverController has been deprecated. Does anybody else have a suggestion as to how to go about this?

I found that this worked after reading through the AppleDocs, in case anyone in the future is wondering.
Also, you’ll have to change the protocol you declared in pg.327 from “UIPopoverControllerDelegate” to “UIPopoverPresentationControllerDelegate”

@interface BNRDetailViewController () <UINavigationControllerDelegate , UIImagePickerControllerDelegate, UITextFieldDelegate, UIPopoverPresentationControllerDelegate>

And you’ll want to change the property you declared from “UIPopoverController” to “UIPopoverPresentationController”

@interface BNRDetailViewController () <UINavigationControllerDelegate , UIImagePickerControllerDelegate, UITextFieldDelegate, UIPopoverPresentationControllerDelegate>

@property (strong, nonatomic) UIPopoverPresentationController *imagePickerPopover;

From there to pg.328 -

//Place image picker on the screen, check for iPad device before instantiating the popover controller 
 if([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
    {
          //Create a  new popover controller that will display the image picker
        imagePicker.modalPresentationStyle = UIModalPresentationPopover;
        
        [self presentViewController:imagePicker animated:YES completion:nil];
        
        UIPopoverPresentationController *presentationController = [imagePicker popoverPresentationController];
        presentationController.delegate = self;
        presentationController.permittedArrowDirections = UIPopoverArrowDirectionAny;
        presentationController.barButtonItem = self.cameraButton;
   
    } else{
        [self presentViewController:imagePicker animated:YES completion:nil];
        
    }

The rest of the code should work, but I’ll have to double check in tomorrow.
Whats interesting here is that you send the message “PresentViewController” before setting configuring your popover.