Skip to content

Instantly share code, notes, and snippets.

@c1800054work
Last active June 21, 2022 08:25
Show Gist options
  • Select an option

  • Save c1800054work/39ae596c3038c3e5afc53cc8ba83d885 to your computer and use it in GitHub Desktop.

Select an option

Save c1800054work/39ae596c3038c3e5afc53cc8ba83d885 to your computer and use it in GitHub Desktop.
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
switch indexPath {
case TableIndex.a:
// do something
case TableIndex.b:
// do something
}
}
private enum TableIndex {
static let a = IndexPath(row: 0, section: 1) //a
static let b = IndexPath(row: 1, section: 1) //b
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment