hierarchyInconsistencyException
Raised if the view controller hierarchy is inconsistent with the view hierarchy.
Declaration
class let hierarchyInconsistencyException: NSExceptionNameDiscussion
When a view controller’s view is added to the view hierarchy, the system walks up the view hierarchy to find the first parent view that has a view controller. That view controller must be the parent of the view controller whose view is being added. Otherwise, this exception is raised. This consistency check is also performed when a view controller is added as a child by calling the addChild(_:) method.
It is also allowed for a view controller that has no parent to add its view to the view hierarchy. This is generally not recommended, but is useful in some special cases.