AFTabledCollectionView icon indicating copy to clipboard operation
AFTabledCollectionView copied to clipboard

how to select uicollectionviewcell in uitableviewcell

Open datouyu123 opened this issue 9 years ago • 4 comments

Thanks for sharing the project. I Want to select uicollectionviewcell in uitableviewcell and push to a new view. But didSelectRowAtIndexPath doesn't work in both uitableview and collectionview. How to fix it? I am new in apple developing, Looking forward to hearing from you soon.

datouyu123 avatar Jan 15 '16 09:01 datouyu123

Hmm, sounds tricky. I think this link should be helpful: http://stackoverflow.com/questions/19256996/uibutton-not-showing-highlight-on-tap-in-ios7

The touch model in iOS is more complex than you might think at first glance. Don't worry – everyone struggles with this at first (I still do sometimes!) and it just takes experimentation and practice. You'll get it!

ashfurrow avatar Jan 16 '16 15:01 ashfurrow

I just was researching this for one of my projects.. Couldn't you implement collectionView didSelectItemAtIndexPath?

Example with the projects example in AFViewController.m:

- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {

    NSArray *collectionViewArray = self.colorArray[[(AFIndexedCollectionView *)collectionView indexPath].item];
    NSLog(@"selected color: %ld", (long)collectionViewArray[indexPath.item]);
}

cjazz avatar Mar 18 '16 03:03 cjazz

Yeah, that would work. I think I misread the original question as being a problem that the callback wasn't being called (because of the touch model). The callback as @cjazz has it is :+1:

ashfurrow avatar Mar 18 '16 13:03 ashfurrow

👍

flyweights avatar Jun 08 '17 07:06 flyweights