Q:

Where is the place to programmatically adjust the view of a UICollectionViewCell?

I would like to programmatically apply some view modifications once a UICollectionViewCell has been created and all its view outlet are being assigned (right as a UIViewController's viewDidLoad method). However I don't want the code to be re-run when the cell is being reused as this view initialization/modifications have to be done only once. Is there a method that I should override in my custom UICollectionViewCell implementation that is being called as soon as the view outlets are assigned?
There is the applyLayoutAttributes: methods that is just called after the view is added to the collection view. However from its name and its description it doesn't sound to be the right place to initialize the view. In addition this method might be called for every re-use as well. However using an initialized-flag this could be worked around.

A:

If it's being loaded from a storyboard or nib then you can do that in.
- (void)awakeFromNib

If it's in code then there is an init method something like initWithFrame:reuseIdentifier.
Somrthing like that anyway.
These are both run once when the cell is first loaded.

