Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break under iOS 5.x #10

Open
shiyunhe opened this issue Sep 21, 2013 · 3 comments
Open

Break under iOS 5.x #10

shiyunhe opened this issue Sep 21, 2013 · 3 comments

Comments

@shiyunhe
Copy link

Tap on a menu and nothing happens. The selector doesn't get executed.

@congxz
Copy link

congxz commented Oct 5, 2013

I have a same problem

@congxz
Copy link

congxz commented Oct 5, 2013

edit KxMenu.m to fix this problem

@interface KxMenuOverlay : UIView
change to
@interface KxMenuOverlay : UIView

  • (id)initWithFrame:(CGRect)frame
    {
    self = [super initWithFrame:frame];
    if (self) {
    self.backgroundColor = [UIColor clearColor];
    self.opaque = NO;

    UITapGestureRecognizer *gestureRecognizer;
    gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                action:@selector(singleTap:)];
    [self addGestureRecognizer:gestureRecognizer];
    

    }
    return self;
    }

change to:

  • (id)initWithFrame:(CGRect)frame
    {
    self = [super initWithFrame:frame];
    if (self) {
    self.backgroundColor = [UIColor clearColor];
    self.opaque = NO;

    UITapGestureRecognizer *gestureRecognizer;
    gestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self
                                                                action:@selector(singleTap:)];
    
    //set delegate
    gestureRecognizer.delegate = self;
    [self addGestureRecognizer:gestureRecognizer];
    

    }
    return self;
    }

add this delegate method:

  • (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
    {
    if ([gestureRecognizer isKindOfClass:[UITapGestureRecognizer class]]) {
    id sender = touch.view;
    if ([sender isKindOfClass:[UIButton class]]) {
    return NO;
    }
    }
    return YES;
    }

@ins52
Copy link

ins52 commented Oct 24, 2013

+1
I also found this bug, fixed it and after that found same solution this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants