コレクションセルがあり、タッチしたときに画像を変更したいのですが、もう一度、どのように構成すればよいですか?
ハイライトした後(下でうまく機能します)、もう一度タッチすると元の画像に戻りたいです。ありがとうございました。viewWillDissapearで、どのセルが強調表示されているか知りたいです。
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
UIImage *backGround =[UIImage imageNamed:@"IconHighlight.png"];
UIImageView *av = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, backGround.size.width, backGround.size.height)];
av.backgroundColor = [UIColor clearColor];
av.opaque = NO;
av.image = backGround;
[[collectionView cellForItemAtIndexPath:indexPath] setBackgroundView:av];
[[collectionView cellForItemAtIndexPath:indexPath].backgroundView setTag:1];
}