How do I properly resize a UICollectionView so that it fully displays its contents? I have tried many things, including setting its frame, calling reloadData an
reloadData
Here's my implementation in Swift 3:
override func sizeThatFits(_ size: CGSize) -> CGSize { if (self.superview != nil) { self.superview?.layoutIfNeeded() } return collectionView.contentSize }