Detect ANY touch in a view (iPhone SDK)

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-04-11T02:19:48Z Indexed on 2010/04/11 2:23 UTC
Read the original article Hit count: 750

Filed under:
|

Hello, I'm currently using ...

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
- (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {

to detect swipes. I've got everything working. The only problem is if the user touches on top of something (eg a UIButton or something) the - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { is not called. Is there something like touchesBegan but will work if I touch ANYWHERE on the view?

Thanks in advance, David

© Stack Overflow or respective owner

Related posts about iphone-sdk

Related posts about objective-c