Home > Software engineering >  Nested CollectionView doesn't receive delegate events?
Nested CollectionView doesn't receive delegate events?

Time:10-16

I have a horizontal collection view embedded in the cell of a vertical collection view (a carousel in a feed unit). For some strange reason, the inner scroll view is not receiving scroll view delegate events like scrollViewDidScroll. It does scroll, I just don't get any notifications about it.

The outer scrollview does, however, receive these events. I suspected the gesture recognizers might be interfering with eachother but I'm not sure. Do you have any idea what might be going wrong here or how I could get the inner collection view to behave normally?

EDIT: I determined that the source of the bug is actually a bug / undefined behavior with compositional layouts with orthogonal scrolling behavior: enter image description here

and this is some sample Debug Console output:

TestingVC Vertical Scrolling (0.0, 100.5)
TestingVC Vertical Scrolling (0.0, 107.5)
TestingVC Vertical Scrolling (0.0, 115.5)
VertItemCell Horizontal Scrolling - Row: 3 contentOffset: (314.5, 0.0)
VertItemCell Horizontal Scrolling - Row: 3 contentOffset: (315.0, 0.0)
VertItemCell Horizontal Scrolling - Row: 4 contentOffset: (1.0, 0.0)
VertItemCell Horizontal Scrolling - Row: 4 contentOffset: (22.5, 0.0)
VertItemCell Horizontal Scrolling - Row: 5 contentOffset: (308.0, 0.0)
VertItemCell Horizontal Scrolling - Row: 5 contentOffset: (307.5, 0.0)
VertItemCell Horizontal Scrolling - Row: 6 contentOffset: (12.5, 0.0)
VertItemCell Horizontal Scrolling - Row: 6 contentOffset: (32.5, 0.0)
  • Related