Relaying Actions from UITableViewCells

Sometimes, it is useful to add a UIControl or one of its subclasses, like a UIButton, to a UITableViewCell. For instance, you want users to be able to tap the thumbnail image in a cell and see a full-size image for that item. In this section, you will do that by adding a transparent button on top of the thumbnail. Tapping this button will show the full-size image in a UIPopoverController when the application is running on an iPad.

Open BNRItemCell.m and stub out a method that will trigger showing the image.

-​ ​(​I​B​A​c​t​i​o​n​)​s​h​o​w​I​m​a​g​e​:​(​i​d​)​s​e​n​d​e​r​
{​

}​

Now, in BNRItemCell.xib, drag a UIButton onto the content view. Remove the text from the button. Select both the ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.