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
1
vote
0 answers

searchBar textDidChange not being called

I know that this is somewhat a common question, but I am trying to call the textDidChange function in my searchBar delegate. I am able to call the updateSearchResults func, but for some reason I am not able to call textDidChange (the print statement…
1
vote
1 answer

How to create a scope search using tableview and searchbarcontroller in swift3

Hello all have designed a scope search using tableview and serchbarcontroller. To achieve this have used below code but somehow its not returning me the actual output. Hoping for the help. Thank you. output : here is my output's ScreenShot code…
TheMiss
  • 43
  • 7
1
vote
0 answers

UITableViewDelegate was not being called

Here I used the UIsearchBar in "TO" and when user search something, I used the UITableView to show the search results. When user select a row from that results table, it will go to the detail page. But In this situation, when user tap on the…
Nyein Ei Ei Tun
  • 168
  • 2
  • 13
1
vote
1 answer

UISearchBarDelegate methods not being called

I had a working search bar and out of nowhere I stopped being able to even to activate any delegate methods. I created the search bar programmatically. Here is my initialization code: self.searchBar.delegate = self …
1
vote
0 answers

search nearby users swift

I have added a "Show nearby friends" button for the search screen but isn't working. If I search for "something" and then push the "Show nearby friends" the search query gets removed and nothing happens. Here it's the code: // MARK: - QUERY…
agis
  • 1,831
  • 10
  • 33
  • 68
1
vote
1 answer

UISearchBarDelegate search button don't work swift 3 iOS 10.3

I had been looking for an answer and I hope you can help me. I don't see mistakes in the code but for some reason the UISearchBarDelegate just don't work when I press the "Search" button. This is my class class BusquedaViewController:…
1
vote
1 answer

How to show different searchResultsController in UISearchController

I am using UISearchController (not UISearchDisplayController), i wanted to show a separate view when search is active. I dont want to use the current view. Tried with self.searchController = UISearchController(searchResultsController:…
1
vote
0 answers

UISearchBar unrecognized selector sent to instance

I've a .json file stored locally from which I'm loading in an array called countries as countries = (NSArray *)[NSJSONSerialization JSONObjectWithData [fileContents dataUsingEncoding:NSUTF8StringEncoding] options:0 error:NULL]; after loading the…
Chaudhry Talha
  • 7,231
  • 11
  • 67
  • 116
1
vote
0 answers

UISearchDisplayController - results exists but are not displayed

I have strange problem with UISearchDisplayController. My code is following: numberOfRowsInSection: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if ([[self searchDisplayController] isActive]) { …
Nizzre
  • 275
  • 1
  • 6
  • 14
1
vote
1 answer

Can't make table view inactive when search bar is in use. iPhone

I have a table view with a search bar above it, and when the search bar is pressed I want the table view to become inactive. So I have this method: - (void)searchBarTextDidBeginEditing:(UISearchBar *)searchBar { …
marty
  • 29
  • 1
1
vote
1 answer

UISearchbar not visible after UINavigationController is instantiated

I have a UISearchBar that is loaded when I click on a searchButton. Accordingly, I have the func searchBarSearchButtonClicked(searchBar: UISearchBar) and func searchBarCancelButtonClicked(searchBar: UISearchBar) delegate methods. However the issue…
1
vote
0 answers

UISearchController's UISearchDisplayController not showing

Couple of months ago I asked a question to show the UISearchDisplayController and it worked like a charm but Now I am presenting another controller after user taps on the searchResultsController's tableview cell and it selects a cell and hides the…
Attiqe
  • 646
  • 1
  • 10
  • 22
1
vote
1 answer

Searching in Realm.io with Swift

I'm trying to implement a tableView searching/filtering for my iOS app that uses Realm.io database. There are very few examples of using search function with this database and I'm kinda lost. There are no official guides for filtering results with…
kernelpanic
  • 2,876
  • 3
  • 34
  • 58
1
vote
1 answer

Search Display to not show results until search bar is tapped

I think I may be missing something obvious: Is there a simple way to modify the UISearchBar or UISearchDisplayController so that it doesn't reload the view after each letter typed but only after the Search button is hit?
1
vote
0 answers

Issue when using a search display controller

I have come across over an issue really weird when trying to reload the table for the search string when I run my project I get an error saying :unexpectedly found nil while unwrapping an Optional value The code is: func tableView(tableView:…