1

I have a UIViewController (not UITableViewController) which has UISearchBar

When the user clicks on the search bar, i want only one row to appear as a suggestion (e.g Go to all Hospitals)

I tried to find examples of using UISearchConteroller but most of them use it for searching a table view

in this link, The answer refers to a UISearchDisplayController which is deprecated in iOS 8

UISearchController in a UIViewController

How can I use UISearchController in regular view just to show one row? and when the user clicks this row, there will be an action

Thanks a lot

Community
  • 1
  • 1
Maha
  • 519
  • 2
  • 11
  • 23
  • 1
    You will need to have a UITableView in your View Controller as well. THen in the delegate methods of the search bar, perform your actions to show the one line in your UITableView – Byron Coetsee Dec 01 '15 at 09:50
  • @ByronCoetsee Thanks a lot – Maha Dec 01 '15 at 10:28

0 Answers0