简体   繁体   中英

Detecting user ended touching screen

in my app i'm able to detect a touch by connecting the view to an action touch down event. However, i want to be able to detect that the user lifted his finger off screen. am i able to do that?

Edit: sorry for the short post. actually i have no hint how to do that or even to try to do that!

Well, that depends on where you're trying to track the touch removal. If for example, you're using a button and you've already linked an action to touchDown, you can simply link another action for the buttons control event touch up inside/outside.

If you're interested in tracking that touches ended on the entire screen, you can use -touchesEnded: withEvent: .

- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
{
    [super touchesEnded:touches withEvent:event];
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM