UIButton
ボタンをクリックしたときにボタン ( is inside UICollectionViewCell
) のテキストを変更したい。セルとボタンを取得するにはどうすればよいですか? カスタムセルがあります。
[cell.shareButton addTarget:self action:@selector(shareAction:) forControlEvents:UIControlEventTouchUpInside];
-(void)shareAction:(UIButton*)button {
NSIndexPath *indexPath = [self.collectionView indexPathForItemAtPoint: [self.collectionView convertPoint:button.center fromView:button.superview]];
NSLog(@"row %d",indexPath.row);
NSLog(@"section %d",indexPath.section);
}