Touch event handled by multiple views

后端 未结 3 1268
挽巷
挽巷 2021-02-06 03:39

I have a subclass of UIView on top of a UITableView. I am using the UITableView to display some data and, at the same time, I would like t

3条回答
  •  情话喂你
    2021-02-06 04:31

    UITableView relays unhandled touch events to UIView. (Google "responder chain") UITableView Documentation

    So, you can handle your touch events in UIView only. So. In your UIView

    1. touchesstart - do initialization stuff

    2. touchesmove - draw tail on UIView (Use timers/delayedresponse to desable points so that it would look like a trail)

    3. touchesend - do remaining stuff

    Hope this helps.

提交回复
热议问题