I have a UIView in which I am adding a UICollectionView to act as a banner view to look like a carousel. The Viewcontroller in which UIView>
I was calling reloadData from multiple places which caused the system to get confused (may be) especially I have written reloadData in my updateconstraints method and hence for each minor constraint change reloadData was getting called.
Check all places from where you call reloadData for collectionview if you're experiencing the same problem.