• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
[iPhone] Preprocessing events sent to UITableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[iPhone] Preprocessing events sent to UITableView


  • Subject: [iPhone] Preprocessing events sent to UITableView
  • From: WT <email@hidden>
  • Date: Sun, 6 Jun 2010 00:51:03 +0200

I need to hijack the set of touch events sent to a UITableView instance prior to allowing the table to process those events.

I have a custom UIView, of which the table view is a subview, and I override -hitTest:withEvent: there (in the custom view) to return self, thereby preventing the table from receiving those touches.

Since my custom view does not implement any of the four event-handling methods (-touchesBegan:withEvent:, etc), the view controller managing my custom view gets the touches, through the regular traversal of the responder chain.

There, in the view controller event-handling methods, I determine whether or not I need to consume the events. If not, I need to send them back to the table view for it to do its normal event handling (for instance, scrolling).

All of the above works fine, except...

... how do I send the touch events back to the table view?

I tried storing the actual result of the hit-test (I'm not going to assume it's the table view) in the custom view prior to returning self as the hit-view, then accessing that from the view controller that manages the custom view, and then invoking the four event-handling methods in the actual hit-view from within the corresponding methods in the view controller, but that didn't work. The table view still doesn't get the touches.

What's the recommended way of doing what I need to do?

Thanks in advance.
Wagner_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: [iPhone] Preprocessing events sent to UITableView
      • From: glenn andreas <email@hidden>
  • Prev by Date: Cross XIB references?
  • Next by Date: Re: setting tab stops in a document
  • Previous by thread: Re: Cross XIB references?
  • Next by thread: Re: [iPhone] Preprocessing events sent to UITableView
  • Index(es):
    • Date
    • Thread