iOS 之页面纯代码与Storyboard的跳转

//将我们的storyBoard实例化,“Main”为StoryBoard的名称

UIStoryboard *mainStoryBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];

 //将第二个控制器实例化,"main"为我们设置的控制器的ID

UIViewController *vc=[mainStoryBoard instantiateViewControllerWithIdentifier:@"main"];

iOS 之页面纯代码与Storyboard的跳转_第1张图片

 //跳转

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

你可能感兴趣的:(iOS 之页面纯代码与Storyboard的跳转)