SearchBarDelegate

@MainActor
open class SearchBarDelegate : DelegateProxy<UISearchBarDelegate>, UISearchBarDelegate

常用SearchBar事件代理,可继承

  • 是否应该开始编辑,默认nil

    Declaration

    Swift

    @MainActor
    open var shouldBeginEditing: ((UISearchBar) -> Bool)?
  • 已开始编辑,默认nil

    Declaration

    Swift

    @MainActor
    open var didBeginEditing: ((UISearchBar) -> Void)?
  • 是否应该结束编辑,默认nil

    Declaration

    Swift

    @MainActor
    open var shouldEndEditing: ((UISearchBar) -> Bool)?
  • 已结束编辑,默认nil

    Declaration

    Swift

    @MainActor
    open var didEndEditing: ((UISearchBar) -> Void)?
  • 文字已改变,默认nil

    Declaration

    Swift

    @MainActor
    open var textDidChange: ((UISearchBar, String) -> Void)?
  • 是否应该改变文字,默认nil

    Declaration

    Swift

    @MainActor
    open var shouldChangeText: ((UISearchBar, NSRange, String) -> Bool)?
  • 点击搜索按钮,默认nil

    Declaration

    Swift

    @MainActor
    open var searchButtonClicked: ((UISearchBar) -> Void)?
  • 点击取消按钮,默认nil

    Declaration

    Swift

    @MainActor
    open var cancelButtonClicked: ((UISearchBar) -> Void)?

Lifecycle

  • 初始化并绑定searchBar

    Declaration

    Swift

    @MainActor
    public convenience init(searchBar: UISearchBar)

UISearchBarDelegate