Created
June 2, 2015 00:39
-
-
Save procload/c11776ba78aeb51446c6 to your computer and use it in GitHub Desktop.
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
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