I'm working on UICollectionView inside UITableViewCell. Using "UICollectionReusableView" as header view. The width of header view is 100. Before I introduce header view the CollectionViewCell started at the beginning of CollectionView, which is as expected. After I put header view, CollectionViewCell starts at end of header view width. I think somewhere position is not set properly.
CollectionView Scroll direction is Horizontal. I have used UICollectionViewFlowLayout to present the CollectionViewCell.
let layout = UICollectionViewFlowLayout()
layout.sectionInset = UIEdgeInsets(top: 5.0, left: 5.0, bottom: 5.0, right: 5.0)
layout.minimumInteritemSpacing = 8.0
layout.minimumLineSpacing = 5.0
layout.scrollDirection = .horizontal
layout.sectionHeadersPinToVisibleBounds = true
collectionView.collectionViewLayout = layout
I have set the size of the header view using "referenceSizeForHeaderInSection" delegate.
Any hints where I might be wrong.