Adding multiple buttons + receiving touchUpInside event inside UICollectionViewCell SWIFT programmatically

∥☆過路亽.° 提交于 2019-12-06 05:50:16

You can set the gesture recognizer to not block the touches in subview

gestureRecognizer.cancelsTouchesInView = false

You can also implement UIGestureRecognizerDelegate and set yourself as delegate. Then you can implement shouldReceiveTouch

optional public func gestureRecognizer(gestureRecognizer: UIGestureRecognizer, shouldReceiveTouch touch: UITouch) -> Bool

There you can check which view is targeted and return false if you don't want to react to the touch in the cells gesture recognizer.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!