I have a UITableView with 5 UITableViewCells. Each cell contains a UIButton which is set up as follows:
- (UITableView
Chris Schwerdt's solution but then in Swift worked for me:
@IBAction func rateButtonTapped(sender: UIButton) {
let buttonPosition : CGPoint = sender.convertPoint(CGPointZero, toView: self.ratingTableView)
let indexPath : NSIndexPath = self.ratingTableView.indexPathForRowAtPoint(buttonPosition)!
print(sender.tag)
print(indexPath.row)
}