1: View [ CollectionView ] 的點(diǎn)擊事件
如果View添加了 Gesture含蓉, 要想 CollectionView 的Cell的點(diǎn)擊事件被處理,需要設(shè)置 gesture.cancelsTouchesInView = false
open var cancelsTouchesInView: Bool
// default is YES. causes touchesCancelled:withEvent: or pressesCancelled:withEvent: to be sent to the view for all touches or presses recognized as part of this gesture immediately before the action method is called.
2: View1 [ View2 ] 的點(diǎn)擊事件
View1 包含 View2,但是View2的點(diǎn)擊事件就是沒有處理(不管把View2 設(shè)置為 UIButton 或者 UIImageView 都不行),最后是 [Debug View Hierarchy]才發(fā)現(xiàn) View2 不在 View1 的 frame 內(nèi)。所以事件沒有傳遞。