Created
June 21, 2022 08:31
-
-
Save c1800054work/fe7c5cc89bb2dd8adf95c229410e7786 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { | |
| let rawValue = indexPath.section*100 + indexPath.row | |
| switch TableIndex(rawValue: rawValue) { | |
| case .a: | |
| // do something | |
| case .b: | |
| // do something | |
| } | |
| } | |
| private enum TableIndex: Int, CaseIterable { | |
| //rawValue = indexPath.section*100 + indexPath.row | |
| case a = 100 //a | |
| case b = 101 //b | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment