You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ji...@apache.org on 2019/04/11 11:25:41 UTC

[incubator-weex] branch master updated: [iOS] Avoid conflict between Pan & Tap gestures.

This is an automated email from the ASF dual-hosted git repository.

jianhan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-weex.git


The following commit(s) were added to refs/heads/master by this push:
     new 3eef58f  [iOS] Avoid conflict between Pan & Tap gestures.
     new b4b7703  Merge pull request #2306 from wqyfavor/fix-click-pan-conflict
3eef58f is described below

commit 3eef58f46bb076307ae8a0cc28c73d2092c361c0
Author: wqyfavor <qi...@taobao.com>
AuthorDate: Thu Apr 11 18:58:58 2019 +0800

    [iOS] Avoid conflict between Pan & Tap gestures.
---
 ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
index 1facd0b..128bcd0 100644
--- a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -859,6 +859,16 @@ if ([removeEventName isEqualToString:@#eventName1]||[removeEventName isEqualToSt
     return NO;
 }
 
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
+{
+    if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] &&
+        [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]]) {
+        return YES;
+    }
+    
+    return NO;
+}
+
 #pragma mark - Utils
 
 - (NSDictionary *)touchResultWithScreenLocation:(CGPoint)screenLocation pageLocation:(CGPoint)pageLocation identifier:(NSNumber *)identifier