宽容他人,放过自己。

在storyboard中添加有条件的页面push

Posted on By anchoriteFili

使用segue进行推


1. 按照惯例进行页面的添加跳转

752372-20151209113400246-128614371.png

2. 设置segue

752372-20151209113529090-944623073.png

3. 使用代码直接进行跳转
[self performSegueWithIdentifier:@"vcToMessageVC" sender:self];

使用storyboard id 进行跳转

UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:nil];
UIViewController *viewController = [storyBoard instantiateViewControllerWithIdentifier:@"test2"]; //test2为viewcontroller2的StoryboardId
     
[self.navigationController pushViewController:viewController animated:YES];