UIStoryboardSegue

在storyboard中设置segue的identifier

UIStoryboardSegue_第1张图片

基本属性

//标示便于在storyboard中找到
@property (nullable, nonatomic, copy, readonly) NSString *identifier;
//源控制器
@property (nonatomic, readonly) __kindof UIViewController *sourceViewController;
//目标控制器
@property (nonatomic, readonly) __kindof UIViewController *destinationViewController

推出下一个界面

//self是原控制器
 [self performSegueWithIdentifier:@"login2contact" sender:nil];

在推出下一个界面的时候会调用以下方法

1.在跳转到下一个界面前做的准备工作

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    //在这个方法可以向下一个界面传入参数
}

你可能感兴趣的:(iOS,UI,导航控制器)