Skip to content

Instantly share code, notes, and snippets.

@procload
Created June 2, 2015 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save procload/c11776ba78aeb51446c6 to your computer and use it in GitHub Desktop.
Save procload/c11776ba78aeb51446c6 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