UIKit collection view, weird behavior (access to / scroll through cells)

So, I recently implemented a collection view in my application, and I got an error that I couldn’t seem to be able to solve, searched it and did not see any threads.

If I have a cursor / finger over the cells, I cannot scroll my collection view. I need to select the "empty" area to scroll.

enter image description here

The second strange behavior I came across is that I cannot directly touch the cell. I need some kind of swipe gesture to call the code when selecting a cell.

enter image description here

, , / . - .

enter image description here

.

/ .

+4
2

, .

delaysContentTouches: , , , . , touchshouldBegin (_: with: in:). - true.

canCancelContentTouches: , , , , Cancelled (_: :), . , .

-, delaymentsContentTouches false. , scrollview , . , , .

-, canCancelContentTouches false. "", ( ), . , , , : , , , .

, , , . , , , ( , , , ) ( , , ).

+3

, , UIGesture ".cancelsTouchesInView = false"

, UIGesture, Your_Gesture.cancelsTouchesInView = false

0

Source: https://habr.com/ru/post/1662465/


All Articles