Warning :-Presenting view controllers on detached view controllers is discouraged
This log message I received when I was running my app and it led to a strange UI glitch, where one of my view in the application lost all of its subviews.
This error occurred once the modal view controller was dismissed.
I had legacy code from the days of iOS 4.0. The view which was losing its subviews is a View controlled by a UIViewController. So this view controller was not added as a ChildViewController of the Parent Controller.
Added the viewcontroller responsible for this problem as a child of the parent controller and the problem was resolved