How can I get the indexPath.row
when a button is tapped? Here is the code I have now:
let alert = SCLAlertView()
let txt = alert.addTextField("Quantity")
txt.keyboardType = UIKeyboardType.NumberPad
txt.text = "\(1)"
alert.addButton("Add to cart") {
var sar:Cart!
let indexPath = self.tableView?.indexPathForSelectedRow
print("\(indexPath.row)")
}
But it didn't work.