UIImagePickerController not presenting in iOS 8

后端 未结 12 1577
借酒劲吻你
借酒劲吻你 2020-12-12 16:39

Is anyone else having an issue with UIImagePickerController in iOS 8? The method below works perfectly well in iOS 7 on an iPad, but I get the following error

12条回答
  •  生来不讨喜
    2020-12-12 17:06

    On iOS 8 you should use the new API:

    if (SYSTEM_VERSION_IOS_8) {
        self.imagePickerController.modalPresentationStyle = UIModalPresentationPopover;
        UIPopoverPresentationController *popPC = self.imagePickerController.popoverPresentationController;
        popPC.barButtonItem = self.popoverItem;
        popPC.permittedArrowDirections = UIPopoverArrowDirectionAny;
        [self presentViewController:self.imagePickerController animated:YES completion:nil]
    }
    

    I recommend you watch the 2014 WWDC session 228 a look in side presentation controllers

提交回复
热议问题