UIViewControllerHierarchyInconsistency when trying to present a modal view controller

This happened to me already twice in the newest Xcode release.
In both cases I needed to make changes to the UIViewController’s XIB file (In you case it would be MapViewController.xib:

BEFORE:

enter image description here

  1. Move main View out of View Controller’s children:
  2. Remove View Controller from the XIB (it is not necessary since File’s Owner should be of its Class already):

AFTER:

enter image description here

Leave a Comment

tech