iOS 17 beta 8 crash UIPrintPanelNavigationController

Hi everyone

I started to see crash in iOS 17 beta 8 when try to show UIPrintInteractionController

for iOS 16 and less it works fine

        let vc = UIPrintInteractionController.shared
        vc.printingItem = pdfFileUrl
        vc.present(animated: true) { (controller, success, error) in }

UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIPrintPanelNavigationController shouldAutorotate] is returning YES

App supported only portrait orientation

in AppDelegate

    func application(_ application: UIApplication, supportedInterfaceOrientationsFor window: UIWindow?) -> UIInterfaceOrientationMask {
        return .portrait
    }

func printInteractionControllerParentViewController should return controller to show

Hi, same problem here. Have you any solution? Can you please explain your reply? Thank you for any advice

I'm seeing the same problem in the general release version of iOS 17

I was overriding present to force iPhone to present with full screen:

class NavigationController: UINavigationController {

// force everything presented to be presented fullscreen on iPhone but NOT on iPad

override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) {

    if UIDevice.current.userInterfaceIdiom == .phone {

        viewControllerToPresent.modalPresentationStyle = .fullScreen

    }

    super.present(viewControllerToPresent, animated: flag, completion: completion)

}

}

When I stopped doing that the problem went away.

It's happening to me too.

Same issue! I am encountering an issue when previewing PDF files using QLPreviewController on devices running iOS 17 or later. The specific problem arises when I attempt to use the print function available in the share sheet of the QLPreviewController. This action results in a same crash.

I am also having same problem.

In iOS 17 below it is working fine.

In iOS 17 if I remove modalPresentationStyle then I dont see any crash.

@Akshay271 UINavigationController. Try this: if (![viewControllerToPresent isKindOfClass:[UINavigationController class]]) { viewControllerToPresent.modalPresentationStyle = UIModalPresentationFullScreen; }

Hi,

It's happening to me too, the application is working fine for iOS 16 and below but on iOS 17 it's giving this error. I tried all the mentioned fixes but still getting this same error.

Was anyone able to pin point the exact reason?

iOS 17 beta 8 crash UIPrintPanelNavigationController
 
 
Q