You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by so...@apache.org on 2017/06/07 08:08:17 UTC

[18/50] incubator-weex git commit: * [ios] remove gesture in case of crash

* [ios] remove gesture in case of crash


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/99a9bbd9
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/99a9bbd9
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/99a9bbd9

Branch: refs/heads/0.14-dev
Commit: 99a9bbd92d48c7afd0a8f27ba14d8a314dc4f6a0
Parents: 41ee7b2
Author: acton393 <zh...@gmail.com>
Authored: Thu May 25 21:46:09 2017 +0800
Committer: acton393 <zh...@gmail.com>
Committed: Fri Jun 2 10:27:00 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/99a9bbd9/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
index 85c767c..7dd496b 100644
--- a/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
+++ b/ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
@@ -270,6 +270,8 @@ if ([removeEventName isEqualToString:@#eventName]) {\
 - (void)removeClickEvent
 {
     if (_tapGesture) {
+        [_tapGesture removeTarget:self action:@selector(onClick:)];
+        [self.view removeGestureRecognizer:_tapGesture];
         _tapGesture.delegate = nil;
         _tapGesture = nil;
     }
@@ -341,6 +343,8 @@ if ([removeEventName isEqualToString:@#eventName]) {\
     }
   
     for (UISwipeGestureRecognizer *recognizer in _swipeGestures) {
+        [recognizer removeTarget:self action:@selector(onSwipe:)];
+        [self.view removeGestureRecognizer:recognizer];
         recognizer.delegate = nil;
     }
     
@@ -394,6 +398,8 @@ if ([removeEventName isEqualToString:@#eventName]) {\
 - (void)removeLongPressEvent
 {
     if (_longPressGesture) {
+        [_longPressGesture removeTarget:self action:@selector(onLongPress:)];
+        [self.view removeGestureRecognizer:_longPressGesture];
         _longPressGesture.delegate = nil;
         _longPressGesture = nil;
     }
@@ -539,6 +545,8 @@ if ([removeEventName isEqualToString:@#eventName]) {\
         && !_listenPanStart && !_listenPanMove && !_listenPanEnd
         && !_listenHorizontalPan && !_listenVerticalPan
         ) {
+        [_panGesture removeTarget:self action:@selector(onPan:)];
+        [self.view removeGestureRecognizer:_panGesture];
         _panGesture.delegate = nil;
         _panGesture = nil;
     }