     }
 
     @IBAction func cancelButtonTapped(_ sender: AnyObject) {
+        self.dismissKeyboard()
         self.delegate?.editBabyViewController(self, didFinishWithBaby: nil)
         
         // Delete temp image if any

    }

    @IBAction func saveButtonTapped(_ sender: AnyObject) {
        self.baby?.givenName = self.givenNameTextField.text
        self.baby?.familyName = self.familyNameTextField.text
        self.baby?.sex = self.sexSegmentedControl.selectedSegmentIndex as NSNumber?

    // MARK: - UIScrollViewDelegate

    func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
        self.dismissKeyboard()
        
        if visiblePickerIndexPath != nil {
            let dateCell: DatePickerCell = tableView.cellForRow(at: self.visiblePickerIndexPath!) as! DatePickerCell
