Loading

Thursday, October 16, 2014

Get Root ViewController of StoryBoard

   

UIStoryboard *mainStoryboard = [UIStoryboard storyboardWithName:@"Main" bundle: nil];
    
    UINavigationController *NavController = (UINavigationController*)[mainStoryboard instantiateViewControllerWithIdentifier:@"NavController"];

    UIViewController *TheViewController=[[NavController viewControllers] objectAtIndex:0];

You need to specify the controller identifier for your navigation controller in the attributes inspector of the navigation controller

No comments:

Post a Comment