Questions tagged [uisearchdisplaycontroller]

UISearchDisplayController is part of Apple's UIKit framework. It greatly simplifies adding UISearchBars to UITableViews.

A UISearchDisplayController manages the display of a search bar, along with a table view that displays search results.

You initialize a search display controller with a search bar and a view controller responsible for managing the data to be searched. When the user starts a search, the search display controller superimposes the search interface over the original view controller’s view and shows the search results in its table view. The searchDisplayController was deprecated in iOS version 8.0

References:

822 questions
149
votes
11 answers

How to filter NSFetchedResultsController (CoreData) with UISearchDisplayController/UISearchBar

I'm trying to implement search code in my CoreData-based iPhone app. I'm not sure how to proceed. The app already has an NSFetchedResultsController with a predicate to retrieve the data for the primary TableView. I want to make sure I'm on the…
jschmidt
  • 2,898
  • 3
  • 24
  • 27
80
votes
7 answers

Assertion failure when using UISearchDisplayController in UITableViewController

I've been trying to add simple Search functionality to a TableViewController in my app. I followed Ray Wenderlich's tutorial. I have a tableView with some data, I added the search bar + display controller in storyboard, and then I have this code:…
acib708
  • 1,573
  • 1
  • 13
  • 24
75
votes
5 answers

How to change background color of UISearchBar in iOS7

How to change background color of UISearchBar in iOS7? not gray, I want to change color like my uinavigationbar if I Use this code, that's what comes out searchBar.backgroundColor = [UIColor redColor]; That is not red color!!! This exact same…
66
votes
15 answers

Prevent a UISearchDisplayController from hiding the navigation bar

Whenever a user begins editing a UISearchDisplayController's search bar, the search controller becomes active and hides the view's navigation bar while presenting the search table view. Is it possible to prevent a UISearchDisplayController from…
66
votes
12 answers

iOS 7 UISearchDisplayController search bar overlaps status bar while searching

I'm updating my app for iOS 7, and I'm in the process of adjusting all my views to account for the new transparent status bar (my app will still use opaque navigation bars). It was relatively easy to adjust for the status bar in every view, except…
61
votes
3 answers

Installed App from TestFlight crashes due to alleged UISearchDisplayController

I implemented Dark Mode with the current beta version of Xcode in a relatively old app. I uploaded these to TestFlight for my testers. However, this crashes immediately for anyone who has the public beta of iOS 13. I've integrated Crashlytics into…
34
votes
1 answer

Displaying search bar in navigation bar in iOS 8

UISearchDisplayController had a boolean property called displaysSearchBarInNavigationBar. What's the equivalent in iOS 8 to have my search bar move up there? Any guidance is greatly appreciated. Here's my code, I'm not entirely sure why this isn't…
Mihado
  • 1,487
  • 3
  • 17
  • 30
31
votes
8 answers

UITableView content overlaps Status Bar when UISearchBar is active

I have a UITableViewController with a UISearchBar and UISearchDisplayController. That exists inside a Container View in a UIViewController which is in a UINavigationController. I made this image to help describe the structure: This is what it…
30
votes
2 answers

UIViewController does not retain its programmatically-created UISearchDisplayController

In the UIViewController documentation about the searchDisplayController property 1 it says: If you create your search display controller programmatically, this property is set automatically by the search display controller when it is…
30
votes
3 answers

How do I close a UISearchDisplayController programmatically?

I want to close my UISearchDisplayController when the user clicks the "Search" button since I'm loading new data from the web. How do I close the controller programatically? I already have the proper method called, but don't know how to do it. I…
Raphael Caixeta
  • 7,808
  • 9
  • 51
  • 76
28
votes
11 answers

Hide UISearchBar Cancel Button

I have a UISearchDisplayController and UISearchBar hooked up to my ViewController via Outlets from my nib. I'd like to hide the cancel button so that the user never sees it. The problem is that the following code hides the button, but only after…
28
votes
4 answers

searchDisplayController deprecated in iOS 8

How do you correct the following so no warnings appear? What am I missing? When correcting the searchResultsController to searchController it gives me an error "object not found" if (tableView == self.searchDisplayController.searchResultsTableView)…
George Asda
  • 2,119
  • 2
  • 28
  • 54
27
votes
8 answers

UISearchDisplayController - how to preload searchResultTableView

I want to show some default content when the user taps the Searchbar, but before any text is entered. I have a solution working using settext: - (void) searchDisplayControllerDidBeginSearch:(UISearchDisplayController *)controller { …
emeer
  • 271
  • 3
  • 3
27
votes
2 answers

UISearchDisplayController's searchResultsTableView's ContentSize is incorrect. Bug in iOS 7?

The below problem only occurs on an iOS 6.0/6.1 application running on an iOS 7.0+ device. So I have a UISearchDisplayController that searches our API and returns data. This all works, and everything is displayed as we want. The only problem we are…
26
votes
2 answers

How do I use the UISearchBar and UISearchDisplayController

I have an app which displays quite a lot of data in a UITableView. I already added the UISearchBar and UISearchDisplayController in Interface Builder to the UITableView. But I do not know how to use it. If someone could provide a quick solution to…
1
2 3
54 55