When you populate the collection data
the webView still does not have time to download the content starts vyschityvanii the height of the element
How to make that first loaded the content then was calculated the height of the element.
If you use dispatch_sync, the app crashes when loading the collection
Marcelina.Jacobson answered on September 26th 19 at 06:15
Don't touch the height in cellForItemAtIndexPath at all. Only after the data is loaded in the UIWebView to change the height of this webView. When this happens, just call - (void)reloadItemsAtIndexPaths:(NSArray *)indexPaths in order indexPath corresponding to this webView. This will update the contents of the desired cell and will request the size of the delegate.
If you are using UICollectionViewDelegateFlowLayout nuinui sizes give in - (CGSize)collectionView:(UICollectionView *)aCollectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath. This method will be called after the call reloadItemsAtIndexPaths