Andrey
Andrey

Reputation: 2729

Refresh ios UIViewController on applicationDidBecomeActive

I need to re-create my current UIViewController in my iOS application on applicationDidBecomeActive. In my code, I adding a lot of runtime graphics to screen, so I think best way to completely recreate it.

I need to solve 2 tasks:

  1. Determine, which UIViewController currently on display (I change view controllers with presentModalViewController command).
  2. Completely repaint it.

Can anybody help me?

Upvotes: 2

Views: 5405

Answers (1)

user2289379
user2289379

Reputation:

may be helpful for u :)

- (void)applicationDidBecomeActive:(UIApplication *)application
{  
   UIViewController* root = _window.rootViewController;
   UINavigationController* navController = (UINavigationController*)root;
   YourViewController * mycontroller = (YourViewController *)[[navController viewControllers] objectAtIndex:0];
   [mycontroller reloadInputViews];
}

Upvotes: 6

Related Questions