     private var context: NSManagedObjectContext!
     private var crudDelegate: CrudViewControllerCRUDDelegate!
     private var tableViewDelegate: CrudViewControllerUITableViewDelegate!
+    private var searchDelegate: CrudViewControllerSearchDelegate!
     private var hideAddItemRow = false
     private var tableUpdates: [String: [IndexPath]]?
     var logger: LogController?
 
-    init(fetchRequest: NSFetchRequest<NSFetchRequestResult>, context: NSManagedObjectContext, crudDelegate: CrudViewControllerCRUDDelegate, tableViewDelegate: CrudViewControllerUITableViewDelegate) {
+    init(fetchRequest: NSFetchRequest<NSFetchRequestResult>, context: NSManagedObjectContext, crudDelegate: CrudViewControllerCRUDDelegate, tableViewDelegate: CrudViewControllerUITableViewDelegate, searchDelegate: CrudViewControllerSearchDelegate) {
         super.init(nibName: nil, bundle: nil)
         self.crudDelegate = crudDelegate
         self.tableViewDelegate = tableViewDelegate
+        self.searchDelegate = searchDelegate
         self.context = context
         setUpFetchedResultsController(withFetchRequest: fetchRequest)
         setUpUI()

            return true
        }

        let term = [ "*", endingText.characters.map { String($0) }.joined(separator: "*"), "*"].joined()
        fetchedResultsController.fetchRequest.predicate = NSPredicate(format: "%K LIKE[cd] %@", "name", term)
        reloadData()

        return true

extension CrudViewController: UITextFieldDelegate {

    func textFieldShouldBeginEditing(_ textField: UITextField) -> Bool {
        if tableViewDelegate.crudViewControllerShouldShowAddItemRow(crudViewController: self) {
            setTableView(toHideAddItemRow: true)
        }
        return true
    }

    func textFieldShouldEndEditing(_ textField: UITextField) -> Bool {
        if tableViewDelegate.crudViewControllerShouldShowAddItemRow(crudViewController: self) {
            setTableView(toHideAddItemRow: false)
        }
        return true
    }

