0

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

谢谢

4

1 回答 1

0

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

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];
}

做同样的事情返回,但不要使用 push,而是使用 pop

于 2013-07-08T22:22:06.120 回答