1

I am seeing constraints errors in my output window when I invoke a UIViewController using PresentViewController

Here is what my view heirarchy looks like:

  1. MainViewController (RootViewController)
    • Outer MainVC Button
    • Nested UINavigationController (Nav1)
      • FirstViewController (Nav1.RootViewController)
        • Nested FirstVC Button
  2. MyModalViewController (Presented by invoking PresentViewController)
    • dismiss button

enter image description here enter image description here

Everything works as expected when MyModalViewController is shown from the Outer MainVC Button, but when I do the same from the Nested FirstVCButton and dismiss it to return back, I get constraint errors and the Nav1 is gone from the MainViewController

enter image description here

I just want to understand why this is happening and any potential workarounds are also welcome.

Full Source Code replicating this issue can be found here https://github.com/raghurana/XamarinIosAutoLayoutBug


Edit

It's a requirement to present MyModalViewController (well modally, thus PresentViewController instead of Push Or Show) due to UX design requirements.

Raghu
  • 2,678
  • 2
  • 31
  • 38

0 Answers0