iOS 技术分享

iOS - 通过代码跳转storyboard页面

2022-07-26  本文已影响0人  Joh蜗牛

1.给storyBoard页面设置storyBoardID:


设置storyboard

2.跳转代码:

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

猜你喜欢

热点阅读