         
         return true
     }
+    
+    func dismissKeyboard() {
+        // Dismiss the keyboard if in note cell
+        if let noteCell = tableView.cellForRow(at: IndexPath(row: 0, section: Section.notes.rawValue)) as? NoteCell {
+            noteCell.textView.resignFirstResponder()
+        }
+    }
 
 
     // MARK: - Actions

            let urls = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)
            let url = urls[urls.count-1].appendingPathComponent("temp.jpg")
            try? UIImageJPEGRepresentation(image, 1)?.write(to: url, options: [.atomic])
            

            self.thumbnailImageView.alpha = 0
            self.thumbnailImageView.image = image

    // MARK: - UIScrollViewDelegate

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