Is it possible to check which UIViewController scene that is active in code?
I have a push notification coming in to the app, and want to do different things depending on what view the user is in, something like this:
AppDelegate:
- (void)application:(UIApplication*)application didReceiveRemoteNotification:(NSDictionary*)userInfo
{
if (tableViewController == active)
//get data from server
else if (detailedViewController == active)
//Get Image from server
}
Thanks
Post a local notification:
and have all of the appropriate viewControllers watch for it:
The viewControllers would add or remove Observers as necesary.