Search code examples
iosswift3uiscrollviewuicollectionview

One Horizontal and one vertical UICollectionView placed within a UIScrollView iOS Swift


I have two collection views within a scrollview. The above collectionview is a horizontal collectionview and the bottom one is a vertical. I am fetching all the data from api. And when I'm reaching at the bottom of the vertical collection view I need to hit a new api to fetch the new data. I am able to do that with the method willDisplayCell, but with that the problem I'm facing is UIScrollView. I can't scroll properly on my device. The bottom UICollectionView can not be scrolled smoothly. Can anyone suggest me something? Thank you


Solution

  • Do not put your collectionView in scrollView. Instead of doing so, put your horizontal collectionView as headerView in vertical collectionView.