         textField.clearButtonMode = .whileEditing
     }
 
-    private func setupCancelButton(_ config: SHSearchBarConfig) {
+    func setupCancelButton(_ config: SHSearchBarConfig) {
         cancelButton.translatesAutoresizingMaskIntoConstraints = false
         cancelButton.alpha = 0.0
         cancelButton.setContentHuggingPriority(UILayoutPriorityRequired, for: .horizontal)


public class SHSearchBar: UIView, UITextFieldDelegate {
    /// The content of this property is used to restore the textField text after cancellation
    private var textBeforeEditing: String?

    /// Constraint that shows the cancel button when active
    var bgToCancelButtonConstraint: NSLayoutConstraint!

        updateUI()
    }

    func setupBackgroundView(_ config: SHSearchBarConfig) {
        backgroundView.translatesAutoresizingMaskIntoConstraints = false
        backgroundView.isUserInteractionEnabled = true
        updateBackgroundWith(0, corners: .allCorners, color: UIColor.white)
    }

    func setupTextField(_ config: SHSearchBarConfig) {
        textField.translatesAutoresizingMaskIntoConstraints = false
        textField.delegate = self
        textField.autocorrectionType = .default
