 
             let alphaAnimations = {
                 searchCancelButton.alpha = hideAddItemRow ? 1 : 0
-                cancelButtonBlurView.alpha = hideAddItemRow ? 1 : 0
+                if let cancelButtonBlurView = self.cancelButtonBlurView {
+                    cancelButtonBlurView.alpha = hideAddItemRow ? 1 : 0
+                }
             }
 
             if hideAddItemRow {


    func setLookAndFeel() {
        if searchDelegate.crudViewControllerShouldEnableSearch(crudViewController: self), let searchField = searchField, let searchContainer = searchContainer, let searchCancelButton = searchCancelButton {
            let fieldBlurView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.dark))
            cancelButtonBlurView = UIVisualEffectView(effect: UIBlurEffect(style: UIBlurEffectStyle.dark))
            guard let cancelButtonBlurView = cancelButtonBlurView else { return }
            cancelButtonBlurView.alpha = 0
            let blurs: [UIView] = [ fieldBlurView, cancelButtonBlurView ]
            blurs.forEach {
                self.view.insertSubview($0, belowSubview: searchContainer)
            }
            fieldBlurView.edgeAnchors == searchField.edgeAnchors
            cancelButtonBlurView.edgeAnchors == searchCancelButton.edgeAnchors

            let searchViews: [UIView] = [ searchField, searchCancelButton ]
            searchViews.forEach { $0.layer.borderWidth = 2 * UIScreen.main.hairlineWidth }

            (blurs + searchViews).forEach {
                $0.clipsToBounds = true
                $0.layer.cornerRadius = 10
            }

            searchField.layer.borderColor = searchField.tintColor.cgColor
            searchCancelButton.layer.borderColor = searchCancelButton.tintColor.cgColor

            searchCancelButton.setTitleColor(searchCancelButton.tintColor, for: .normal)
        }
    }


@available(iOS 11.0, *)
@objc public protocol CrudViewControllerThemeDelegate {
    @objc optional func crudViewController(crudViewController: CrudViewController, themeAddItemCell addItemCell: TextAndAccessoryCell)
    
    /// Sylize the search controls.
    ///
    /// - Parameters:
    ///   - crudViewController: the crud controller containing the search controls to style
    ///   - searchField: the text input for search
    ///   - cancelButton: the cancel button to end search
    @objc optional func crudViewController(crudViewController: CrudViewController, theme searchField: UITextField, cancelButton: UIButton)
    
    /// Ask the theme delegate if the search controls should be given blur backgrounds and vibrancy effects. Defaults to `false`.
    ///
    /// - Parameter crudViewController: the crud controller containing the search controls
    /// - Returns: `true` if the search field and cancel button should be blurred, `false` otherwise
    @objc optional func crudViewControllerShouldBlurSearchControls(crudViewController: CrudViewController) -> Bool
    
    @objc optional func crudViewControllerEmptyStateView(crudViewController: CrudViewController) -> UIView
}

