从可重用的Cell中出列时,自定义CollectionViewCell会触发什么方法?

zan*_*ona 4 reuseidentifier ios uicollectionviewcell

ItemCollectionViewCell通常使用其父ViewController中的方法将可重用的自定义出列

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

但是ItemCollectionViewCell我已经实现了initWithFrame最初只调用的方法,但是当一个单元格被重新使用时没有被调用.

ItemCollectionView在调用[collectionView dequeueReusableCellWithReuseIdentifier:@"cell" forIndexPath:indexPath]父视图控制器之后,在重新添加到队列之前触发内部的方法是什么?

Car*_*zey 7

-[UICollectionReusableView prepareForReuse]是方法.是该方法的文档.