forum

Home / DeveloperSection / Forums / Getting tap gesture on UICollectionViewCell in iOS.

Getting tap gesture on UICollectionViewCell in iOS.

Anonymous User 1714 24-Dec-2015

I am created a collection view cell to display multiple images. My problem is how to get tap gesture on a small icon, which is on top right cell image.

I am using this code:

UITapGestureRecognizer *tapRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(projectSetting:)];
iconButton = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"imageName.png"]];
iconButton.frame = CGRectMake(50, 10, 50, 50);
[iconButton addGestureRecognizer:tapped];
[cell addSubview:iconButton];

Please anyone tell me what's wrong in my code?


Updated on 25-Dec-2015
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By