Here is the problem I am facing:
I have a UITabBarController as the root view controller. It manages 4 view controllers - A,B,C,D. C is a navigation controller that has C1 and C2 view controllers in the view hierarchy.
The objective is to open C1 view controller when the user taps on the notification in the notification center.
The problem - When the user taps on the notification, I change the tab selectedIndex to 2 (for C) which loads the view C. And in the ViewDidAppear of C, I push to C1. Problem with this approach is that for momentarily user sees view C before being transitioned to C1 (because I am doing the transition in viewDidAppear of C). I can't do this transition in viewDidLoad or viewWillAppear of C because runtime throws an error of inconsistency.
If I take an alternative approach of directly pushing C1 from my delegate than the selected tab remains the past one. If I change the selected index of the tab than it loads C again.
Any help will be appreciated.