         searchBar.returnKeyType = dataSource?.returnKeyType(for: searchBar) ?? .search
         searchBar.placeholder = dataSource?.placeholder(for: searchBar)
         separatorView.isHidden = dataSource?.isSeparatorViewHidden(above: searchBar) ?? false
+        buttonType = dataSource?.buttonType(for: button, currentButtonType: buttonType)
         apply(theme: theme)
     }
 

    
    func searchBarTextDidBeginEditing(_ searchBar: UISearchBar) {
        delegate?.searchBarTextDidBeginEditing(searchBar)
    }
    
    func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
        delegate?.searchBarTextDidEndEditing(searchBar)
    }
    
    func searchBar(_ searchBar: UISearchBar, textDidChange searchText: String) {

    @IBOutlet weak var separatorView: UIView!
    @IBOutlet weak var searchBar: UISearchBar!
    @IBOutlet weak var button: UIButton!
    private var buttonType: SearchBarExtendedViewButtonType? {
        didSet {
            button.setTitle(buttonType?.title, for: .normal)
        }
    }
    
    weak var dataSource: SearchBarExtendedViewControllerDataSource?
    weak var delegate: SearchBarExtendedViewControllerDelegate?
