Skip to content

Instantly share code, notes, and snippets.

@KC-218
Last active March 29, 2018 08:48
Show Gist options
  • Save KC-218/6d44c0b6792d954fb447e4dae369d5b8 to your computer and use it in GitHub Desktop.
Save KC-218/6d44c0b6792d954fb447e4dae369d5b8 to your computer and use it in GitHub Desktop.
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell: CustomCell = CustomCell()
cell.button.tag = indexPath.row
cell.button.addTarget(self, action: #selector(buttonClicked(sender:)), for: .touchUpInside)
}
func buttonClicked(sender: UIButton) {
print(sender.tag)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment