     open var searchButton: UIButton!
     open var navigationItem: UINavigationItem!
     
+    open var isActive = false
+    
     open func setupWithDelegate(_ delegate: CNLSearchControllerDelegate, navigationItem: UINavigationItem, buttonImage: UIImage?, searchQueryText: String? = nil) {
         self.delegate = delegate
         searchButton = UIButton(frame: CGRect(x: 0, y: 0, width: 30, height: 30))

            withDuration: 0.5,
            animations: {
                self.searchButton.alpha = 0.0
        },
            completion: { finished in
                // remove the search button
                self.navigationItem.rightBarButtonItem = nil
                // add the search bar (which will start out hidden).
                self.navigationItem.titleView = self.searchBar
                self.searchBar.alpha = 0.0
                
                UIView.animate(
                    withDuration: 0.5,
                    animations: {
                        self.searchBar.alpha = 1.0
                },
                    completion: { completed in
                        self.searchBar.becomeFirstResponder()
                }
                )
        }
        )
    }
    

    }
    
    open func searchBarCancelButtonClicked(_ searchBar: UISearchBar) {
        searchBar.text = nil
        if (searchQueryText ?? "") != "" {
            searchBarSearchButtonClicked(searchBar)
        }
        deactivate(animated: true)
    }
    
}
