brightec / CustomCollectionViewLayout

Custom layout for a collection view using horizontal and vertical scrolling with sticky rows and columns
MIT License
519 stars 123 forks source link

PrepareLayout section variable unidentified #20

Closed nipun0505 closed 6 years ago

nipun0505 commented 6 years ago

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