开发者

Forward touches to a view and cause UIGetureRecognizer to begin

开发者 https://www.devze.com 2023-01-28 06:43 出处:网络
Is there a way to forward touches to a subview which has a gesture recognizer attached, and that the forwarded even开发者_如何学Cts will initiate the gesture recognizer?I got it to work with a little

Is there a way to forward touches to a subview which has a gesture recognizer attached, and that the forwarded even开发者_如何学Cts will initiate the gesture recognizer?


I got it to work with a little workaround (might not be suitable in all cases...).
Because UIGestureRecognizers get their events from the sendEvent method before UIViews do, I created a custom 'ForwarderGestureRecognizer' on the outer view and all this view does is to forward the events to the recognizers of the subview view when required.

0

精彩评论

暂无评论...
验证码 换一张
取 消