我有一个UITableView
显示一些元素,当我单击每个单元格时,我可以看到它的 detailViewController。我想从一个 detailViewController 传递到下一个UISwipeGestureRecognizer
向左移动,如果我UISwipeGestureRecognizer
向右移动,则返回 tableView。
谢谢
我有一个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];
}
做同样的事情返回,但不要使用 push,而是使用 pop