Last active
August 29, 2015 14:05
-
-
Save raphweiner/b0b78779ddc08edd637b to your computer and use it in GitHub Desktop.
swift switch
This file contains 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
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
switch (indexPath.section) { | |
case 0: | |
{ | |
switch (indexPath.row) { | |
case 0: | |
{ | |
// yo dawg, i heard you like switch statements | |
} | |
} | |
} | |
} | |
} | |
override func tableView(tableView: UITableView!, didSelectRowAtIndexPath indexPath: NSIndexPath!) { | |
switch (indexPath.section, indexPath.row) { | |
case (0, 1): | |
// yay | |
case (1, let row): | |
// zomg | |
default: | |
// yahoo | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment