     
     @IBOutlet var tableView: UITableView!
     
+    var selectedIndexPath: IndexPath?
     var moc: NSManagedObjectContext?
     var babies: [Baby] {
         let fetchRequest:NSFetchRequest<NSFetchRequestResult> = NSFetchRequest(entityName: "Baby")

    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        
        self.tableView.reloadData()
    }
    
    override func didReceiveMemoryWarning() {

        } else if segue.identifier == "SegueShowBabyDetail" {
            let babyDetailViewController = segue.destination as? BabyDetailViewController
            
            selectedIndexPath = self.tableView.indexPathForSelectedRow
            babyDetailViewController?.moc = self.moc
            babyDetailViewController?.baby = babies[(selectedIndexPath?.row)!]
        }
    }
    
