Tuesday, December 6, 2022
HomeiOS Developmentios - RootViewController's constraints get eliminated after calling VNDocumentCameraViewController

ios – RootViewController’s constraints get eliminated after calling VNDocumentCameraViewController

After presenting and dismissing the VNDocumentCameraViewController, I get a black display screen. After some analysis, I discovered that just a few constraints disappear after dismissing the digicam view controller.

Here’s a comparability of the view hierarchy earlier than and after the VNDocumentCameraViewController.

enter image description here

Modifications I seen:

  1. UILayoutContainerView‘s constraints are fully gone
  2. RootTabBarContoller‘s constraints are halved.
  3. “Place and dimension are ambiguous” signal

And right here is the view hierarchy when the VNDocumentCameraViewController is current.

enter image description here

The basis view controller is initialized in a scene delegate like this:

func scene(_ scene: UIScene, willConnectTo session: UISceneSession, choices connectionOptions: UIScene.ConnectionOptions) {
    guard let windowScene = scene as? UIWindowScene else {
    window = UIWindow(windowScene: windowScene)
    window?.rootViewController = RootTabBarController()

I used to be considering to attempt a storyboard because the preliminary scene however all my views use XIBs and I couldn’t discover learn how to import them right into a storyboard.

Does the basis view controller (RootTabBarController in my case) want additional constraints or another configuration to be able to maintain such transitions?



Please enter your comment!
Please enter your name here

Most Popular

Recent Comments