美文网首页
从storyboard跳到xib [Segue from Sto

从storyboard跳到xib [Segue from Sto

作者: PengPengPro | 来源:发表于2017-02-21 14:04 被阅读28次

    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];

    相关文章

      网友评论

          本文标题:从storyboard跳到xib [Segue from Sto

          本文链接:https://www.haomeiwen.com/subject/pncuwttx.html