uitableviewcontroller edit索引中的行不能与uipageviewcontroller一起使用

时间:2014-11-11 13:06:33

标签: ios uitableview uigesturerecognizer uipageviewcontroller uiswipegesturerecognizer

我有一个UIPageViewController,它包含一堆viewcontrollers。其中一个子视图控制器是一个uitableviewcontroller,它有一些可以编辑/删除的行

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.row == 0  || indexPath.row == 1 || indexPath.row == 2 || (indexPath.row == 3 && hasMore) || indexPath.row == 1 + 1 + 1 + 1 + self.media.comments.count - 1 + (hasMore ? 1 : 0)){
    return NO;
}
Comment *comment = [self.media.comments objectAtIndex:(indexPath.row - 3 - (hasMore ? 1 : 0))];
if (comment.user.userId != [Data sharedInstance].currentUser.userId)
    return NO;
return YES;

}

我现在的问题是,因为当我在其中一个应该可编辑的单元格上滑动时,我有一个uipageviewcontroller作为父级,所以uipageviewcontroller获取触摸和更改页面而不是接收触摸并显示编辑菜单的表格

那里的任何想法?

由于 克里斯

1 个答案:

答案 0 :(得分:0)

我实际上发现你可以使用这个第三方库,这将允许菜单的滑动手势让总统通过uipageviewcontroller滑动

https://github.com/WinterKirk/MKSlidingTableViewCell

重要的是你的整个视图不应该只有这些细胞导致uipageviewcontroller无法刷卡

但是在你可以说它下面有图像和评论的情况下它会很有用,人们应该可以删除评论但是可以刷到所有其他单元格上的下一张图片

相关问题