UIView滑动手势与目标c中的tableview冲突

时间:2016-05-31 14:30:54

标签: ios objective-c uitableview uiview uiswipegesturerecognizer

我的项目中有20多个viewcontrollers,并在全局viewcontroller类中添加了滑动手势。

- (void)navigateToPreviousScreen:(UISwipeGestureRecognizer *)sender { 

[self.navigationController popViewControllerAnimated:YES];}

并覆盖所有子类

class MyStringItemSource: NSObject, UIActivityItemSource {

@objc func activityViewControllerPlaceholderItem(activityViewController: UIActivityViewController) -> AnyObject {
    return ""
}

@objc func activityViewController(activityViewController: UIActivityViewController, itemForActivityType activityType: String) -> AnyObject? {
    //You can pass different text for for diffrent activity type
    if activityType == UIActivityTypePostToFacebook {
        return "String for facebook"
    }else{
        return "String for Other"
    }
  }
}

现在我遇到了一个问题(不是一个问题),一些视图控制器有表格视图,滑动有时不起作用(也有一些触摸敏感问题)。有没有办法解决它。我设置cancelsTouchesInView =否但似乎出现问题。

先谢谢。

1 个答案:

答案 0 :(得分:0)

你应该能够通过实施& amp;在父类的以下UIGestureRecognizerDelegate方法中返回YES。

  - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
        return YES;
}