저는 다중 선택 UICollectionView를 구현하기 시작했습니다. 아래는 "안전한"코드로 간주 될 것입니까? (AccessoryView 대신 BackgroundView라고하는 이유를 가정했기 때문에)? 나는 약간의 노력을 덜고, 배열을 통해 추가 사용을 위해 indexpath에서 선택한 항목을 추적하려고합니다.UICollectionView 셀 : cell.selectedBackgroundView를 앞에 가져 오는 것이 안전할까요?
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
//....
cell.selectedBackgroundView = someView_With_A_Checkmark_Image;
[cell bringSubviewToFront:cell.selectedBackgroundView];
//...
return cell;
}
소리가 좋습니다. 특정 상황에서 콘텐츠보기에 추가하는 대신 내 생각에 이상하게 느껴지는 것이 궁금했습니다. – ceekay