Create an outlet action: And find the indexpath using this code
@IBAction func memberPicTapped(_ sender:UIButton) {
var superView = sender.superview
while !(superView is UITableViewCell) {
superView = superView?.superview
}
let cell = superView as! UITableViewCell
if let indexpath = YourTableView.indexPath(for: cell){
}
}