Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Want to fire IBAction on Touch up Inside of Static TableViewCells

I have a Static TableViewCells on a storyboard. There are just labels in those cells. I would like to fire IBAction event upon touch. What I am doing right now is create a full-size white button and linked to IBAction. But it doesn't show highlighted color when the cell is selected because cell is behind the button.

like image 287
zhtway Avatar asked Dec 07 '25 10:12

zhtway


1 Answers

UITableViewCells have a delegate method specifically for handling row touches -tableView:didSelectRowAtIndexPath:

If you need a custom button over each cell, subclass UITableViewCell instead of going through a storyboard. As much as they may be a timesaver, storyboards are really a limiting factor when it comes to nitty gritty iOS programming.

like image 124
CodaFi Avatar answered Dec 09 '25 00:12

CodaFi