Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swipe to delete on a tableView that is inside a PagingViewController #542

Closed
estebanmons opened this issue Dec 15, 2020 · 1 comment
Closed

Comments

@estebanmons
Copy link

When I slide the delete action into a TableView cell it doesn't work. Switch to the other ViewController in Paging:

func tableView(_ tableView: UITableView, trailingSwipeActionsConfigurationForRowAt indexPath: IndexPath) -> UISwipeActionsConfiguration? {

    let deleteAction = UIContextualAction(style: .destructive, title: nil) { (_, _, _) in
          //Action
    }

    deleteAction.image = #imageLiteral(resourceName: "ic_trash_clear")
    deleteAction.backgroundColor = .red
    let configuration = UISwipeActionsConfiguration(actions: [deleteAction])
    configuration.performsFirstActionWithFullSwipe = true
    return configuration
}

Please some help!

@rechsteiner
Copy link
Owner

Hey @estebanmons! Do you want to support both swipe actions and swiping between pages? From a UX perspective it sounds a bit like you should disable the page swiping using contentInteraction = .none. If you really want to support both swiping gestures at the same time you need to cancel the gesture recognizer for the pageViewController.scrollView when starting to the table view swipe. Take look at the documentation here on how to cancel gesture recognizers: https://developer.apple.com/documentation/uikit/uigesturerecognizer/1624203-requiregesturerecognizertofail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants