Skip to content

Instantly share code, notes, and snippets.

@raphweiner
Last active August 29, 2015 14:05
Show Gist options
  • Save raphweiner/b0b78779ddc08edd637b to your computer and use it in GitHub Desktop.
Save raphweiner/b0b78779ddc08edd637b to your computer and use it in GitHub Desktop.
swift switch
- (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