IOS UiCollectionView - reloadData using custom UiCollectionViewLayout

I am trying to use a custom UiCollectionViewLayout, but I have a little problem. In my project, I want to load some JSON information and present it in a UICollectionView. I need to download information from WEB, and then (when everything is loaded) I need to reload my Collection View. If I use UICollectionViewFlowLayout , everything will be fine. However, when I try to use my own layout, reloadData does not work correctly and nothing happens.

I reload the data using async task:

 dispatch_async(dispatch_get_main_queue(), ^{ [self.newsCollectionView reloadData]; }); 

thanks

+4
source share
1 answer

It looks like you are looking for an invalidateLayout that calls prepareLayout , collectionViewContentSize , layoutAttributesForElementsInRect: calls, etc.

+2
source

All Articles