Segue from Storyboard to XIB

后端 未结 1 956
夕颜
夕颜 2021-02-04 20:28

I have a storyboard View Controller, which is the first screen in my app. The rest of the app is designed with xib\'s. I want to segue from a button in the storyboard\'s VC to a

相关标签:
1条回答
  • 2021-02-04 20:46

    From xib to storyboard

    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
    UIViewController *initViewController = [storyBoard instantiateInitialViewController];
    

    then

    [self.window setRootViewController:initViewController];
    

    or

    [self.navigationController pushViewController:initViewController animated:YES];
    

    From storyboard to xib

    YourViewController *viewController=[[YourViewController alloc]initWithNibName:@"ViewControllerName" bundle:nil];
    
    [self presentViewController:viewController animated:YES completion:nil];
    

    In case of NavigatinController

    [self.navigationController pushViewController:viewController animated:YES];
    
    0 讨论(0)
提交回复
热议问题