Last active
August 29, 2015 14:22
-
-
Save BradB132/61f107228f053bc752ed to your computer and use it in GitHub Desktop.
GettingStartedWithCustomUICollectionViewLayouts-1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)prepareLayout | |
{ | |
//don't forget to call super here | |
[super prepareLayout]; | |
/* pre-calculate and cache whatever you need here */ | |
//maybe you would want to loop over each cell like this? | |
for(NSUInteger i = 0; i < [self.collectionView numberOfSections]; i++) | |
{ | |
for(NSUInteger j = 0; j < [self.collectionView numberOfItemsInSection:i]; j++) | |
{ | |
/* calculate something for the cell at row j in section i */ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment