Elias
Elias

Reputation: 21

Which image was selected in a 2 column UITableView

I just started with Iphone development and would like to know the following.

I have a UITableView setup with 2 columns each cell has an image. When the user clicks a cell I want to push another view and display a large image of the one that was clicked.

Under the method didSelectRowAtIndexPath, allows me to push a new view however with 2 columns in one row not sure how to determine which image was click.

Thanks Elias

Upvotes: 2

Views: 157

Answers (2)

vikingosegundo
vikingosegundo

Reputation: 52227

Instead of making Buttons (as recommend by tsakoyan), you could add GestureRecognizer to your column views.

Upvotes: 1

tsakoyan
tsakoyan

Reputation: 1891

didSelectRowAtIndexPath works for the whole row only. What you can do is make your column cells or your images into a UIButton so you can handle the events on them separately.

Upvotes: 1

Related Questions