Presenting a view for the first time in appDelegate

后端 未结 4 1189
遥遥无期
遥遥无期 2020-12-22 07:21

The goal:

When my app starts up - I need it to display a view before it gets to the \"Home\" screen. Its a tab bar application and this view is not

4条回答
  •  遥遥无期
    2020-12-22 08:07

    If Tabbarcontroller is your root viewcontroller, then using below code will resolve the issue in your appdelegate.

     -(void)showCountrySettings
      {
    
         if (self.termsHaveBeenAccepted){
    
        BBCounterySettingsViewController *countrySettings = [[BBCounterySettingsViewController alloc]initWithNibName:@"View" bundle:nil];
    
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
        UIViewController *vc = [storyboard instantiateViewControllerWithIdentifier:@"IDENTIFIER"];
        UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
    
        [tabBarController presentModalviewcontroller:vc animated:YES completionblock:nil];
      }
    

提交回复
热议问题