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

IOS 7 becomeFirstResponder does not fire searchBarCancelButtonClicked delegate

I am using a button to show and hide the searchbar. I am using the this code to display the - (IBAction)searchButton:(id)sender { [self.searchDisplayController setActive:YES]; [self.searchDisplayController.searchBar…
1
vote
2 answers

Customizing UISearch bar

I am trying to customize my search bar like this So far I have managed to do upto this Now I need to know how to add image on right side, shaping the corners and changing background to an image. This is my code so far. I can do this with help of…
Francis F
  • 3,157
  • 3
  • 41
  • 79
1
vote
2 answers

UISearchBar results not shown

I'm using UISearchBar in my app. - (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { [self.filtered removeAllObjects]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.companyName contains[cd]…
user906492
  • 31
  • 2
1
vote
2 answers

searchBarSearchButtonClicked doesn't work together with shouldChangeTextInRange

I have the following UISearchBar delegate method that works by its own (it's called when it's alone). -(void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{ [self downloadFruits:searchBar.text]; [self.view endEditing:YES]; } When I…
Alexey
  • 7,127
  • 9
  • 57
  • 94
1
vote
0 answers

Getting ScopeButtons to work in MonoTouch UISearchBar

I've created a custom UISearchBarDelegate. In the OnEditingStarted-event, I'm adding scope buttons to the search bar: public override void OnEditingStarted(UISearchBar searchBar) { searchBar.ScopeButtonTitles = new[] { "Scope 1", "Scope 2" }; …
Jacco
  • 3,251
  • 1
  • 19
  • 29
1
vote
1 answer

UISearchbar how to determine if last character typed is a backspace

I have a UISearchbar with delegate method - (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText { if(searchText.length>3){ [self updateSearchString:searchText]; } } updateSearchString goes out to the internet to get the…
Eric
  • 1,014
  • 2
  • 13
  • 22
1
vote
0 answers

search display controller and hitting the cancel button causes search results to not render

I have a UITableViewController that implements the UISearchBarDelegate and UISearchDisplayDelegate protocols. I have gotten a bug where if I click on the Cancel Button in the search bar, it won't render further queries. I can output our search…
timpone
  • 19,235
  • 36
  • 121
  • 211
0
votes
1 answer

How can I search data from tableview cell?

I have an UITableview controller which representing fetched XML data. For representing these data I used five UILabel. Now I have to add a searchbar at the top of the UITableview. So programmatically I have added a searchbar. Now I have used…
Emon
  • 958
  • 3
  • 10
  • 28
0
votes
2 answers

How to get characters with uitextfield in searchbar before clicking ok button with keyboard?

I have a UISearchBar with UITextField, and when I input a letter to the UITextField in Chinese or Japanese, just like "w", I found that the keyboard will show a panel which let user to choice a chinese word, but before I choice a word, I found that…
0
votes
1 answer

search bar not working?

i have a SQL file where 5 different type of data is stored. I am adding this data in a dictionary specified with keys. and then i am adding this dictionary to tableData array as a dataSource for table and searchBar. But it is not searching anything.…
0
votes
1 answer

How to import api data from WordPress blog page into searchDelegate function in flutter?

I created dart pages, but I don't know how to set data into searchDelegate function Api code import 'dart:convert'; import 'package:http/http.dart' as http; class ApiNewsPage { String baseUrl =…
0
votes
1 answer

Implementation of basic flutter search bar failed

So I followed a tutorial on how to implement a basic Flutter search bar with search Delegation. You can find the tutorial on this link: https://www.youtube.com/watch?v=FPcl1tu0gDs class DataSearch extends SearchDelegate{ final…
Lash
  • 333
  • 1
  • 2
  • 14
0
votes
1 answer

Is it possible to change handling order of TableView and SearchBar Delegates?

I have custom class, inherited from UISearchBar with dropdown tableview, and both delegates related to this class. I've notice, that UISearchBarDelegate methods calls before UITableViewDelegate, but for my goals I need to change it. Is it possible…
nastassia
  • 807
  • 1
  • 12
  • 31
0
votes
2 answers

UIKit SearchBar Filter Two Arrays in textDidChange

I have two initialized and uninitialized arrays as follows: var colours: [String] = ["Blue", "Red", "Green", "Yellow"] var numbers: [Int] = [11, 12, 13, 14] var coloursFiltered: [String]? var numbersFiltered: [Int]? In my search bar, I could…
0
votes
0 answers

Like button on wrong cell for UITableView after search

In my app, the users can like specific cells. Everything works perfectly up until I search for a specific post and like it. In the photos, I search up "Ghastly" which before searching and filtering is the 4'th cell. So when I search it and like it…
user15709097