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 6251573
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:38:20+00:00 2026-05-24T13:38:20+00:00

Currently I am trying to recreate the Twitter (iPad) type control. Mostly because all

  • 0

Currently I am trying to recreate the Twitter (iPad) type control. Mostly because all the versions available online are not really working for the type of application I am developing, and I think I can do better of course 😉 (but it is harder than I thought).

What I want:

  • Flexible positioning of the view controllers I add to the control
  • No need to change my current view controllers when I want to use them in my control (mainly because I use the view controllers in the iPhone and the iPad version).
  • Being able to drag the view controllers around, but still keep al functionality in the view controllers.

What I currently got:

  • Good positioning on the view controllers, when they are added to my control.
  • Able to drag the view controllers around, according to the rules I have set (maximum x position etc)

My problem is that when I add a UITableViewController, I want to be able to drag it around AND keep the functionality of scrolling and selecting cells in the table.

My current solution is, that when a view controller is added to my control, I add a subview to it (with the same size of the view controller) which accepts all the touches. These touches are then send to the control, by using a delegate and calling methods on it. This works well, accept that when I add a subview to my UITableViewController, there is some weird behavior. Scrolling up and down still works in the UITableViewController, but these touches aren’t detected by the View on top of the UITableViewController. Selecting cells in the table does not work anymore, because these touches are taken by the overlaying UIView.

I add the overlaying UIView to the UITableViewController like this:

SNOverlayView* layover = [[SNOverlayView alloc] initWithFrame:CGRectMake(0,0, controllerWidth, self.frame.size.height)];
layover.delegate = self;
[controller.view addSubview:layover];
[layover release];

My custom overlay UIView contains a couple of these methods, for all the touch (began, ended, cancelled and moved) methods:

- (void) touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
if ([delegate respondsToSelector:@selector(overlayTouchesBegan:touches:event:)])
    [delegate overlayTouchesBegan:self touches:touches event:event];

    NSLog(@"%@", self.nextResponder);   

    [self.nextResponder touchesBegan:touches withEvent:event];
}

From what I understand from the documentation, the call to the nextResponder, should make sure that the TableView below my view also receives the touches. But these methods only get triggered when I touch the screen once OR slide sideways. Sliding from up to down does not trigger these methods and touching a cell does not trigger the didSelectRowAtIndexPath from the UITableViewController. The self.nextResponder in this method is a UITableView (which is outputted by the NSLog in that method).

I am misunderstanding the nextResponder part? Isn’t this possible when not modifying my UITableViewController?

EDIT: I updated the structure which I add to my main UIView containing all ViewControllers:

|- Root UIView (1)
|-- Containment UIView which detects touches (2)
|---- UITableViewController (3)

The problem is that now my containment view (2) does not detect touches. I will try to update my code to make it more like the structure mentioned below:

|- Root UIView (1)
|-- Containment UIView (2)
|---- UIView detecting touches (4)
|---- UITableViewController  (3)

But I am not sure how I can get the UIView to detect touches. because when I add the UITableViewcontroller (3) to my containment UIView (2) it will be put on top of the UIView detecting the touches (4) and therefor ‘stealing’ the touches. I would rather change the order of (4) and (3).

  • 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-05-24T13:38:21+00:00Added an answer on May 24, 2026 at 1:38 pm

    Are you adding a subview to a UITableView? This is dangerous, because it will scroll with the cells (UITableView is a sub-class of UIScrollView), and because the UITableView adds and removes subviews itself too, so you can’t control the order that the views are in.

    I think your best bet would be to have a view hierarchy like this

    - containerView (plain UIView, that your UIViewController loads)
    |-- overlayView (catches touches)
    |-- UITableView
    

    That being said, I’ve got a suspicion that UIScrollViews use a different method for grabbing touches to other UIViews (i.e. not touchesBegan: etc.).

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

Sidebar

Related Questions

I'm currently learning Python using Zelle's Introductory text, and I'm trying to recreate one
I am currently trying to recreate the google+ navigation to the left, where you
I currently trying to find a solution, how to ensure that a test fails
I'm currently trying to read in an XML file, make some minor changes (alter
I'm currently trying out db4o (the java version) and I pretty much like what
I'm currently trying to build a personal website to create a presence on the
I'm currently trying to port a SIP stack library (pjSIP) to the PSP Console
I'm currently trying to get into the Java EE development with the Spring framework.
My team is currently trying to automate the deployment of our .Net and PHP
I'm currently trying to debug a customer's issue with an FTP upload feature in

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.