Send Row and Section through Tag in Button Swift
问题 I have this inside cellForRowAtIndexPath cell.plusBut.tag = indexPath.row cell.plusBut.addTarget(self, action: "plusHit:", forControlEvents: UIControlEvents.TouchUpInside) and this function outside: func plusHit(sender: UIButton!){ buildings[sender.tag].something = somethingElse } Is it possible to send the indexPath.row and indexPath.section , or some alternative?? Thanks! EDIT I approached it like this: My Custom Button class MyButton: UIButton{ var myRow: Int = 0 var mySection: Int = 0 }