Skip to content

Instantly share code, notes, and snippets.

@BradB132
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BradB132/61f107228f053bc752ed to your computer and use it in GitHub Desktop.
Save BradB132/61f107228f053bc752ed to your computer and use it in GitHub Desktop.
GettingStartedWithCustomUICollectionViewLayouts-1
-(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