Skip to content

Instantly share code, notes, and snippets.

@procload
Created June 2, 2015 00:39
Show Gist options
  • Save procload/e6693ba4b93a206b0e5b to your computer and use it in GitHub Desktop.
Save procload/e6693ba4b93a206b0e5b to your computer and use it in GitHub Desktop.
override func prepareForSegue(segue: UIStoryboardSegue, sender: AnyObject?) {
if segue.identifier == "pushDetail" {
let cell = sender as! UITableViewCell
let indexPath = tableView.indexPathForCell(cell)!
let timerModel: TimerModel = {
if indexPath.section == 0 {
return self.coffeeTimers[indexPath.row]
} else {
return self.teaTimers[indexPath.row]
}
}()
let detailViewController = segue.destinationViewController as? TimerDetailViewController
detailViewController?.timerModel = timerModel
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment