2017-10-12 90 views
0

我在UIPageViewController内部有UITableView,并且滑动事件似乎没有传递给UITableView从UIPageViewController向UITableView传递删除轻扫手势

我能够禁用我的UIPageViewController的边缘弹跳,但我仍然没有找到一种方法来一致地启用滑动来删除我的UITableView

In this sample, it takes multiple swipes to get the delete button to show up. The gesture is extremely finicky on an actual device

在此示例中,它需要多个挥笔得到的删除按钮来显示。该手势在实际设备上非常挑剔

页面在右侧没有其他页面,因此UIPageViewController没有理由需要滑动。

viewDidLoad我:

for view in self.pageViewController.view.subviews { 
    if let scrollView = view as? UIScrollView { 
     scrollView.delegate = self 
    } 
} 

下面,我有:

​​

有很多不同的答案相关的帖子,但没有人对我的使用情况下工作。

+0

这是比我的问题的解决方案更多的替代方案,但我只是使用MGSwipeTableCell。这很容易实现。 https://github.com/MortimerGoro/MGSwipeTableCell – ChrisRockGM

回答

0

您可以通过使用datasource禁用UIPageViewController的刷卡,只需用setViewControllers:direction:animated:completion方法提供contents.Hope中的tableView轻扫可以工作。

+0

我必须显示多个页面,所以我不知道如何在不完全拆开'UIPageViewController'的情况下实现这个功能。 – ChrisRockGM