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

  • SEARCH
  • Home
  • 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 8923423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T07:06:51+00:00 2026-06-15T07:06:51+00:00

I put UIButton inside UITableViewCell in UITableView that is behind UIScrollView . I subclassed

  • 0

I put UIButton inside UITableViewCell in UITableView that is behind UIScrollView. I subclassed UIScrollView to forward touches to UITableView.

So method from UITableViewDelegate didSelectRow is calling properly. The problem is that UIButton inside table cell is not receiving TouchUpInside actions.

How can I solve this problem without deleting ScrollView over TableView?

EDIT:

I resolved this issue by detecting which view will receive touch. Here’s the code:

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    UIView *hitView = [self hitTest:[(UITouch*)[[touches allObjects] objectAtIndex:0] locationInView:self] withEvent:event];
    if ([hitView isKindOfClass:[UIButton class]]) {
        [(UIButton*)hitView sendActionsForControlEvents:UIControlEventTouchUpInside];
    }
    [super touchesBegan:touches withEvent:event];
}
  • 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-15T07:06:55+00:00Added an answer on June 15, 2026 at 7:06 am

    If you want to enable actions for bouth objects – UIScrollView and UIButton you should to implement custom hit test mechanism for ScrollView.

    In your UIScrollView subclass override – (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event method to make views behind ScrollView available for getting events.

    - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event
    {
        return __touchesEnabled;
    }
    
    - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
    {
        _touchesEnabled = NO;
        UIWindow *window = [UIApplication sharedApplication].delegate.window;
        for(UITouch *touch in touches) {
           CGPoint point = [touch locationInView:self];
           point = [window convertPoint:point fromView:self];
           UIView *view = [window hitTest:point withEvent:event];
           [view touchesBegan:touches withEvent:event];
        }  
        _touchesEnabled = YES;
    }
    

    It works for me

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom button, subclassed from UIButton that is initialised as below (obviously
I've got a UIButton called tagButton and a UIScrollView called tagsView. Inside my -(void)renderTags
I've got a UIButton that I create at runtime. I put a title on
I have one UIButton . I put one image on that. When I click
Can I put a UIButton in a subclassed UIView to create graphics for the
I've put a UIButton inside a custom UIView and the button is not receiving
I want to put an animation to custom UIButton's title so that the numbers
I thought to be clever and just put an transparent UIButton over an UIImageView
Put simply, I want to select all data in two columns from each of
I put together this quick carousel that I'm using to cycle through different divs

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.