Two ways can be implemented -- Need to provide zero height or a height constraint to collectionView in storyboard
and now in View will Appear just try these two simple steps
Get Contentsize height and Set frame height
HotDealsCollectionView.frame.size.height = HotDealsCollectionView.contentSize.height
Get Height On base of number of cells
HotDealsCollectionView.frame.size.height = (Array.count * Static height if you provided)
Can call LayoutsIfNeeded() At end of both Options
Prefer First As Second will work if you are showing one in a row I mean Vertical CollectionView whereas in first option you will get its ContentSize height which you are actually looking for
NOTE: If in case your result is not getting expected like after adopting these options Frame size is not increased the just add some static height value at end like
HotDealsCollectionView.frame.size.height = HotDealsCollectionView.contentSize.height + 50
Hope it Helps