[英]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.