Can I detect if higher subview has been touched?

Posted by Kevin Beimers on Stack Overflow See other posts from Stack Overflow or by Kevin Beimers
Published on 2009-08-17T10:16:57Z Indexed on 2010/05/25 0:01 UTC
Read the original article Hit count: 346

I've got a big UIView that responds to touches, and it's covered with lots of little UIViews that respond differently to touches. Is it possible to touch anywhere on screen and slide around, and have each view know if it's being touched?

For example, I put my finger down on the upper left and slide toward the lower right. The touchesBegan/Moved is collected by the baseView. As I pass over itemView1, itemView2, and itemView3, control passes to them. If I lift my finger while over itemView2, it performs itemView2's touchesEnded method. If I lift my finger over none of the items, it performs baseView's touchesEnded.

At the moment, if I touch down on baseView, touchEnded is always baseView and the higher itemViews are ignored.

Any ideas?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about objective-c