简体   繁体   中英

How to enable UITableView swipe to delete along with horizontal page swiping

In one of my app, I am having multiple table views inside a horizontal scroll view. So, user can horizontally swipe between table views. I am not using UIPageViewController for some reason.

The problem that I am facing is that I have swipe to delete feature on my UITableView but does not work when I have multiple pages in the horizontal scroll view.

Is there an elegant way to provide both the features at the same time?

You can subclass UIScrollView and implement UIGestureRecognizerDelegate. Then return true in gestureRecognizer(_:,shouldRecognizeSimultaneouslyWith) for the appropriate recognizers.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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