I'm attempting to change a view when specific push notifications come through, I've had minor success. (Using parse with push notifications, catering for when the App is open and closed).
My Storyboard looks like this, I'm attempting to change the view within AppDelegate to DetailViewController.

Now I'm able to change views by changing the root controller, but I've only been able to attach either my tab view or the navigation not both.
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
DetailViewController *detail = (DetailViewController *)[mainStoryboard instantiateViewControllerWithIdentifier:@"detail"];
[detail setDetailItem:StreamData[2]];
self.window.rootViewController = detail;
And of course the use of (below) only works in other controllers.
[self.navigationController pushViewController:detail animated:YES];
I'm wondering if this can be achieved from AppDelegate while maintaing the tabbar at the bottom and the navigation at the top?
My initial work around is to set a trigger from the AppDelegate to a global var accessible from all controllers and then use something like viewDidAppear to check if they view needs to change. This seems way too resource intensive though but it maintains my layouts.
My issue is similar to this: pushing view controller inside a tab bar from app delegate, after a notification
I have done a work around in your problem. Created some scene's,not sure it going to work in your case. Anyway give a try
My storyboard

What I have done
UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
[(UITabBarController *)self.window.rootViewController setSelectedIndex:1];
UINavigationController *nav = [[(UITabBarController *)self.window.rootViewController viewControllers]objectAtIndex:1];
UIViewController *detail = [mainStoryboard instantiateViewControllerWithIdentifier:@"detail"];
[nav pushViewController:detail animated:NO];
This gives me the detail view controller with a button as the first view with tab bar and navigation controller
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With