CombineCocoa icon indicating copy to clipboard operation
CombineCocoa copied to clipboard

When using UIScrollViewDelegateProxy and UICollectionViewDelegateProxy, one is ignored

Open itsol-ka opened this issue 4 years ago • 1 comments

Describe the bug When using UIScrollViewDelegateProxy and UICollectionViewDelegateProxy, one is ignored

code

let collectionView = UICollectionView(frame: .zero, collectionViewLayout: layout)
self.collectionView.didSelectItemPublisher.sink { _ in
    print("not called")
}
.store(in: &self.cancellableSet)

self.collectionView.didEndDraggingPublisher.sink { _ in
    print("called")
}
.store(in: &self.cancellableSet)

itsol-ka avatar Oct 12 '21 08:10 itsol-ka

I'm running into this exact same thing except with UITableView instead of UICollectionView. I'm subscribed to the willBeginDraggingPublisher and didScrollPublisher of the table view, and also subscribed to the didSelectRowPublisher, and only the didSelectRowPublisher is firing. I previously also had an additional didSelectRowPublisher that was ignored. It seems that all publisher subscriptions but one are lost when we have multiple subscriptions on UIScrollView/UI(Table/Collection)View.

toastersocks avatar Nov 22 '21 20:11 toastersocks