Skip to content

Commit

Permalink
* [ios] fix A component onclick event
Browse files Browse the repository at this point in the history
  • Loading branch information
acton393 committed Sep 1, 2016
1 parent 47197ab commit 01f9706
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
19 changes: 19 additions & 0 deletions ios/sdk/WeexSDK/Sources/Component/WXAComponent.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,13 @@ - (instancetype)initWithRef:(NSString *)ref type:(NSString *)type styles:(NSDict
return self;
}

- (void)dealloc
{
if (_tap.delegate) {
_tap.delegate = nil;
}
}

- (void)viewDidLoad
{
[self.view addGestureRecognizer:_tap];
Expand Down Expand Up @@ -63,4 +70,16 @@ - (void)updateAttributes:(NSDictionary *)attributes
}
}

#pragma mark
#pragma gesture delegate

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
{
if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
return YES;
}

return NO;
}

@end
4 changes: 0 additions & 4 deletions ios/sdk/WeexSDK/Sources/Events/WXComponent+Events.m
Original file line number Diff line number Diff line change
Expand Up @@ -525,10 +525,6 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni
return YES;
}

if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
return YES;
}

//#ifdef DEBUG
// if ([gestureRecognizer isKindOfClass:[WXDebugLongPressGestureRecognizer class]]
// || [otherGestureRecognizer isKindOfClass:[WXDebugLongPressGestureRecognizer class]]) {
Expand Down

0 comments on commit 01f9706

Please sign in to comment.