繁体   English   中英

uiswipegesturerecognizer从UITableview IOS的​​详细视图传递

[英]uiswipegesturerecognizer to pass from detail views of an UITableview IOS

我有一个UITableView显示一些元素,当我单击每个单元格时,我可以看到它的detailViewController。 我想从一个detailViewController传递到下一个,将UISwipeGestureRecognizer移到左侧,如果我将UISwipeGestureRecognizer移至右侧,请返回tableView。

谢谢

将滑动识别器添加到视图或表格视图

UISwipeGestureRecognizer *swipeLeft = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(goToNextView)];

    [swipeLeft setDirection:UISwipeGestureRecognizerDirectionLeft];
    [self.view addGestureRecognizer:swipeLeft]; //Add to the view or tableview or whatever

添加方法

- (void)goToNextView
{
     YourViewController *vc =
     [self.storyboard instantiateViewControllerWithIdentifier:@"yourViewControllerIdendifier"];
     [self.navigationController pushViewController:vc animated:YES];
}

进行相同的操作以返回,但不要使用推,而要使用pop

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM