Which method runs in a custom CollectionViewCell when removed from a reusable cell?

I remove the reusable custom ItemCollectionViewCell as usual using the method from its parent ViewController

 - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { ItemCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]; } 

but on my ItemCollectionViewCell I have implemented the initWithFrame , which is called only initially, but not when the cell is deleted for reuse.

What will be the method that runs inside the ItemCollectionView before re-adding to the queue after calling [collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath] on the parent view controller?

+4
source share
1 answer

-[UICollectionReusableView prepareForReuse] is a method. Here is the documentation for the method.

+6
source

All Articles