I have imported UICollectionViewDelege, UICollectionViewDatasource and UIScrollViewDelegate.
I have set my collection views delegate and datasource to self.
But scrollViewDidScroll isnt being called, my scroll view goes horizontal if that makes a difference?
Why is scrollViewDidScroll not being called if collection views use the scrollview inside them?
I was moving form swift 2 to swift 3 and what did the trick is the following:
swift 2:
public func scrollViewDidScroll(scrollView: UIScrollView)
to swift 3:
public func scrollViewDidScroll(_ scrollView: UIScrollView)
So basically the "_" underscore did the trick. What is annoying is that swift compiler didn't complain about it!!!
As for inheritance UICollectionViewDelegate
should do the trick.
I had to add information that my controller conforms to UIScrollViewDelegate protocol in order to make it work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With