开发者

Call two UIGestureRecognizer at the same time

开发者 https://www.devze.com 2023-03-29 09:44 出处:网络
Here\'s the question: I have an UIScrollView with an UIButton as a subView. Both the UIScrollView and the UIButton have an UILongPressGestureRecognizer assigned to them. Is it possible that if the UIL

Here's the question: I have an UIScrollView with an UIButton as a subView. Both the UIScrollView and the UIButton have an UILongPressGestureRecognizer assigned to them. Is it possible that if the UILongPress开发者_StackOverflow中文版GestureRecognizer of the UIButton is called the one of the UIScrollView gets called too?


A simple way to do this would be to manually call the long-press handling function for your scrollview when the button is long-pressed. You shouldn't try and run more than one thing on your interface at the same time, because interface code needs to be executed only on the main thread.

0

精彩评论

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

关注公众号