前一页建立跳转事件
// 添加左边导航栏按钮
UIBarButtonItem *leftButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(leftButtonAction:)];
self.navigationItem.leftBarButtonItem = leftButton;
#pragma mark - 导航栏左边按钮实现
- (void)leftButtonAction:(UIBarButtonItem *)sender
{
// 模拟推出页面,被推出的页面
AddViewController *addVC = [[AddViewController alloc] init];
[self presentViewController:addVC animated:YES completion:nil];
}
后一页跳转回来
// 添加点击事件
[self.rootView.cancleButton addTarget:self action:@selector(cancleButtonDidClickde:) forControlEvents:UIControlEventTouchUpInside];
// 实现点击事件
- (void)cancleButtonDidClickde:(UIButton *)sender
{
// 跳到前一页
[self dismissViewControllerAnimated:YES completion:nil];
}
版权声明:本文为博主原创文章,未经博主允许不得转载。
时间: 2024-11-10 11:33:00