Last active
June 1, 2023 16:10
-
-
Save bryanluby/fd5ac0a8c74c2c3241d9 to your computer and use it in GitHub Desktop.
Switch on indexPath using tuple example in Swift.
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
switch (indexPath.section, indexPath.row) { | |
case (0, _): println("section 0") | |
case (1, _): println("section 1") | |
case (2, 0...2): println("section 2 0-2") | |
case (2, 3...5): println("section 2 3-5") | |
case (3, let row): println("\(row)") | |
default: println("") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment