I have a tableView dynamically populated with custom cells in several sections.
In my CustomCell class I have an @IBAction for a custom checkbox button in the cell.
You can easily find the row by calculating the position of the sender and finding the row at that position in the UITableView
var position: CGPoint = sender.convertPoint(CGPointZero, toView: self.tableView)
if let indexPath = self.tableView.indexPathForRowAtPoint(position)
{
let section = indexPath.section
let row = indexPath.row
}
This is how Apple does it in the Accessory sample. https://developer.apple.com/library/ios/samplecode/Accessory/Listings/AccessoryViewController_m.html#//apple_ref/doc/uid/DTS40008066-AccessoryViewController_m-DontLinkElementID_4