 
 public class SHSearchBar: UIView, UITextFieldDelegate {
     /// The content of this property is used to restore the textField text after cancellation
-    private var textBeforeEditing: String?
+    var textBeforeEditing: String?
 
     /// Constraint that shows the cancel button when active
     var bgToCancelButtonConstraint: NSLayoutConstraint!

        fatalError("init(coder:) has not been implemented")
    }

    private func updateAllViewConstraints() {
        let isInitialUpdate = backgroundView.constraints.isEmpty
        let isTextFieldInEditMode = bgToCancelButtonConstraint?.isActive ?? false


        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
