Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8626151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:57:21+00:00 2026-06-12T07:57:21+00:00

Apparently iOS 6 tries to automatically handle the situation when you have a gesture

  • 0

Apparently iOS 6 tries to automatically handle the situation when you have a gesture recognizer and a UIButton in the same place, being activated for the same gesture.

This new automatic handling solves the issue when you want to click the button instead of activating the gesture recognizer, but creates a new problem when you want the gesture recognizer to act.

In iOS 5 you could implement:

-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch

to transfer the action to the UIButton when in a conflict.

This doesn’t seem to work in iOS 6. Also, inverting the behavior of this method (because now the UIButton has the priority instead of the gesture recognizer) won’t work.


Complete method:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
    if ([touch.view isKindOfClass:[UIControl class]]){
        return NO;
    }
    return YES;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T07:57:22+00:00Added an answer on June 12, 2026 at 7:57 am

    I’ve done this to workaround the issue, change it as you see fit:

    - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch {
          [self MyCommonSelector];// this will work for ios 5
          return Yes;
     }
    

    Add target in button where you declare so this will call in iOS 6:

    [self.myButton addTarget:self action:@selector(MyCommonSelector)
      forControlEvents:UIControlEventTouchUpInside];
    

    Do your stuff in this method which will also be called on button tap and from the gesture you need to call:

    -(void)MyCommonSelector
     {
        //Do your stuff here what you want to do with Gesture too.
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code.... file_parser::file_parser(string file){ txtfile.open(file.c_str(), ios::in); if (!txtfile.good()){ string error=err(0, +file+ not
We have an application that support iAds. Apparently iOs 4.2 for iPad will support
My CoreMIDI connection on iOS is apparently fast enough to handle ANYTHING that hits
Apparently the latest version of iOS is 5.1. I have been developing an iPad
Apparently, my use of Twitter oAuth (token request) doesn't work in iOS 5... how
Apparently mutableCopy copies by reference, not value. Ie if I do this: NSMutableArray arrayA
I don't seem to get this SIGABRT I keep getting. I have this storyboard
Using Titanium Appcelerator SDK 1.7.1 for iOS 4.3 I have a TableViewRow and need
I am working on an app targeted for > iOS 4. In this app
thank you for taking some time to read my question. I have this app

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.