如何以编程方式从xib导航到故事板

时间:2015-12-02 10:10:10

标签: ios objective-c uinavigationcontroller storyboard

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

View3ViewController *view_3 =[view3 instantiateViewControllerWithIdentifier:@"view3_id"];

[self.navigationController presentViewController:view_3 animated:YES completion:nil];

1 个答案:

答案 0 :(得分:0)

您可以加载故事板文件

UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

从故事板加载控制器:

UIViewController *vc = [sb instantiateViewControllerWithIdentifier:@"myViewController"];

并出示此控制器

vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:NULL];