美文网首页iOS 技术分享
iOS - 通过代码跳转storyboard页面

iOS - 通过代码跳转storyboard页面

作者: Joh蜗牛 | 来源:发表于2022-07-26 16:07 被阅读0次

    1.给storyBoard页面设置storyBoardID:


    设置storyboard

    2.跳转代码:

    UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"MainStoryBoard” bundle:nil];
    HomeViewController *vc = [storyBoard instantiateViewControllerWithIdentifier:@“这里是设置的StoryBoardID];
    [self.navigationController pushViewController:vc animated:YES];
    

    相关文章

      网友评论

        本文标题:iOS - 通过代码跳转storyboard页面

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