//MARK: Actions
@IBAction func unwindToMealList(sender: UIStoryboardSegue) {
- if let sourceViewContoller = sender.sourceViewController as? MealViewController, let meal = sourceViewContoller.meal {
+ if let sourceViewContoller = sender.source as? MealViewController, let meal = sourceViewContoller.meal {
// Add new meal.
let newIndexPath = IndexPath(row: meals.count, section: 0)
meals.append(meal)
tableView.insertRows(at: [newIndexPath], with: .automatic)
}
}
//MARK: Actions
@IBAction func unwindToMealList(sender: UIStoryboardSegue) {
- if let sourceViewContoller = sender.sourceViewController as? MealViewController, let meal = sourceViewContoller.meal {
+ if let sourceViewContoller = sender.source as? MealViewController, let meal = sourceViewContoller.meal {
// Add new meal.
let newIndexPath = IndexPath(row: meals.count, section: 0)
meals.append(meal)
tableView.insertRows(at: [newIndexPath], with: .automatic)
}
}