In the Objective-C version of CustomCollectionViewLayout.m, inside the prepareLayout method, following code is written:
// Tip: If we don't know the number of columns we can call the following method and use the NSUInteger object instead of the NUMBEROFCOLUMNS macro
// NSUInteger numberOfItems = [self.collectionView numberOfItemsInSection:section];
prepareLayout, will be called everytime the bounds change. In that case what would be the value of "section" variable for "numberOfItemsInSection:section". I can't see to find it. If I uncomment it, in my code, it gives error, if I use your file, everything is fine.
I just copied the demo's .m file into my project's .m file
In the Objective-C version of CustomCollectionViewLayout.m, inside the prepareLayout method, following code is written:
prepareLayout, will be called everytime the bounds change. In that case what would be the value of "section" variable for "numberOfItemsInSection:section". I can't see to find it. If I uncomment it, in my code, it gives error, if I use your file, everything is fine.
I just copied the demo's .m file into my project's .m file