I have a weird issue in iOS 12 when using solution as explained here.
It works great when collection view loads for first time, however when I try to reload the collection view using either collectionView.reloadData()
or collectionView.collectionViewLayout.invalidateLayout()
, a weird height to cell is added.
Once I start scrolling everything will be normal again. Please see images below. First image shows working heights for cells after view loads. Second one shows cells after reload is pressed.
The reload bar button calls following method.
@objc func reloadCollectionView() {
collectionView.collectionViewLayout.invalidateLayout()
}
Please view sample project in GitHub here for reproducing the issue. I used Xcode 10.1 and 10.2 to reproduce the issue.
Any kind of help or direction for resolving the issue would be highly appreciated!
Thanks in advance.