1, collectionView
-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{
//cell不是自定义
UICollectionViewCell * cell = (UICollectionViewCell *)[collectionView cellForItemAtIndexPath:indexPath]; //即为要得到的cell
//自定义的cell
MyViewCell * cell = (MyViewCell*)[self collectionView:collectionView cellForItemAtIndexPath:indexPath];//即为要得到的cell
}
2,tableView
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//非自定义cell
UITableViewCell * cell = (UITableViewCell *)[tableView cellForRowAtIndexPath:indexPath];
//自定义cell
MyViewCell * cell = (MyViewCell*)[self tableView:tableView cellForRowAtIndexPath:indexPath];
}