Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to select uicollectionviewcell in uitableviewcell #13

Open
datouyu123 opened this issue Jan 15, 2016 · 4 comments
Open

how to select uicollectionviewcell in uitableviewcell #13

datouyu123 opened this issue Jan 15, 2016 · 4 comments

Comments

@datouyu123
Copy link

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.

@ashfurrow
Copy link
Owner

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!

@cjazz
Copy link

cjazz commented Mar 18, 2016

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]);
}

@ashfurrow
Copy link
Owner

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 👍

@flyweights
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants