Using collectionViewLayout.collectionViewContentSize instead of contentSize so it works right after calling reloadData.