Questions tagged [uisearchbardelegate]

The UISearchBarDelegate protocol defines the optional methods you implement to make a UISearchBar control functional.

The UISearchBarDelegate protocol defines the optional methods you implement to make a UISearchBar control functional. On UISearchBarDelegate, you can find the following methods:

Editing Text

– searchBar:textDidChange:

– searchBar:shouldChangeTextInRange:replacementText:

– searchBarShouldBeginEditing:

– searchBarTextDidBeginEditing:

– searchBarShouldEndEditing:

– searchBarTextDidEndEditing:

Clicking Buttons

– searchBarBookmarkButtonClicked:

– searchBarCancelButtonClicked:

– searchBarSearchButtonClicked:

– searchBarResultsListButtonClicked:

Scope Button

– searchBar:selectedScopeButtonIndexDidChange:

150 questions
0
votes
1 answer

SearchBar text empty when searchBarSearchButtonClicked called

I've implemented the searchBarSearchButtonClicked delegate method in my view controller - (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { searchBar.text = textView.text } The method is successfully called when the "Search"…
am17
  • 3
  • 1
  • 2
0
votes
0 answers

The search bar does not search for words entered in the search field

I have a problem with the search bar, when I load the app the Json data is loaded correctly in the table view, but if I enter a word in the search field nothing happens, the data is not searched and the tableView remains the…
SwiftLove
  • 31
  • 1
  • 6
0
votes
1 answer

How do I create a search bar for my firebase object

I have a firebase database and I want to create a search bar that will filter results from the database objects. But I do not know how to go about it. I have looked everywhere to find a good example but none of those I find are related to…
0
votes
2 answers

UISearchBar: passing data; Title that is clicked on does not correspond with data that is shown in ListViewController - Swift

I'm currently having an issue with my UISearchBar. So when I search for a word, the UISearchBar returns the data that matches the letter(s)/word that I typed. However, when I click one of the tableview cells, the (title) data does not correspond to…
Nicolas G
  • 15
  • 7
0
votes
1 answer

With UISearchController in IOS, what delegate methods are fired when you click outside of search box

With a UISearchController and UISearchBar in IOS, when the searcher is active and the clicks on cancel the following delegate method is trigged: - (void)searchBarCancelButtonClicked:(UISearchBar *)searchBar; However, if the user merely clicks…
user6631314
  • 1,751
  • 1
  • 13
  • 44
0
votes
0 answers

UISearchBar get notified when selected

I'm trying to build a view like Instagram's explore page. To be precise I want to have one view with a UISearchBar in the navigation bar and if the search bar is selected/tapped I want to transition to a new view. I'm working with SwiftUI and…
0
votes
1 answer

UISearchBarDelegate in landscape doesn't work

Quite simply, I'm implementing UISearchBarDelegate, but in landscape mode it looks wrong. The search bar doesn't stretch all the way right. Is UISearchBarDelegate not suppose to be used in landscape or is there a solution?
Andy A
  • 4,191
  • 7
  • 38
  • 56
0
votes
1 answer

How to return an array of objects using SearchBar and for loop

I am wanting the search bar to return the title for each object in the Array. I believe the problem is in my for loop but I am not completed sure. Hopefully, you guys are able to tell me what I am doing wrong. I am searching through an API. This is…
Andrew
  • 27
  • 4
0
votes
1 answer

Implementing UISearchBar with UITableView

So I have an app that lets users select movies from a list in tableview (populated by api), tapping on a movie presents a view with more details. I would like to implement a search bar so users can search for specific movies, however I am having…
Astiop
  • 21
  • 1
0
votes
1 answer

Swift SearchBar inTableView doesn't show the correct Data in the filtered rows

My app is using Firebase Realtime Database to store information of each user. The tableView works fine. I added a searchBar and when I type letters in the searchBar, I can see that the amount of rows presented in the tableView is equal to the amount…
0
votes
3 answers

UITableView reloadData() causing reload to UISearchBar inside every sections

I have a tableview which has 2 sections. Both of the sections have UISearchBar in the indexPath.row 0 and the rest of the rows in each section populate the list of array. Whenever I type some text in search bar every time the searchBar(_ searchBar:…
0
votes
2 answers

Why searchBarTextDidEndEditing not called?

I have this code: extension VC : UISearchBarDelegate { func searchBarTextDidEndEditing(_ searchBar: UISearchBar) { print("searchBarTextDidEndEditing") } func searchBarCancelButtonClicked(_ searchBar: UISearchBar) { //…
Saeed Alasiry
  • 322
  • 5
  • 23
0
votes
1 answer

Swift iOS 13 - scopeBar in searchBar not displayed in TitleView

Prior to iOS 13, when the search bar became the first responder, the below code displayed the scope bar with two scope bar buttons, which is the intended behavior. With iOS 13, the search bar still functions correctly, however the scope bar is no…
oldCoder
  • 61
  • 4
0
votes
1 answer

UISearchBar not displaying correctly in UTableViewHeader

Added a uisearch bar and uisearchbardisplaycontoller programatically (NO XIB) and the search bar sorta displays in the table header but is non functional. if setActive:YES, setActive:NO on the display controller it appears just fine and is…
0
votes
1 answer

Trying to set background color of UISearchController in Swift 5

I am trying to set the background color of a UISearchController in Swift 5. I have tried methods mentioned in other threads but I believe they are outdated. searchController.barTintColor = UIColor.redColor() Error Message: Value of type…