CombineCommunity / CombineCocoa

Combine publisher bridges for UIKit
MIT License
1.67k stars 133 forks source link

When using UIScrollViewDelegateProxy and UICollectionViewDelegateProxy, one is ignored #61

Open itsol-ka opened 3 years ago

itsol-ka commented 3 years ago

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)
toastersocks commented 2 years ago

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.