Contents

searchBar(_:shouldChangeTextIn:replacementText:)

Ask the delegate if text in a specified range should be replaced with given text.

Declaration

optional func searchBar(_ searchBar: UISearchBar, shouldChangeTextIn range: NSRange, replacementText text: String) -> Bool

Parameters

  • searchBar:

    The search bar that is being edited.

  • range:

    The range of the text to be changed.

  • text:

    The text to replace existing text in range.

Return Value

true if text in range should be replaced by text, otherwise, false.

See Also

Managing the search text