Luis Delgado
Luis Delgado

Reputation: 3734

iOS 8 Displaying search results without Search Bar

I am working on an application that will let users type usernames in a TextView. Users will type the "@" character before typing a username, so the app will capture text after the "@" character and do a server-side search for users whose usernames start with the entered text.

Once I get the result of possible usernames from the search, I want to display a tableview to the user with the usernames found for the typed string (this is the same scenario as when mentioning people in the Facebook app. Type @ + someone's name and a tableview will show up with possible results).

I was looking at the UISearchController on the Apple documentation, which seems like it will do the job of displaying the search results in a table, but it looks to me so far that it will always require a Search Bar with it.

So the question is: can you instantiate and display search results using a UISearchController without a Search Bar, or is there a better way to display search results to the user in my scenario?

Upvotes: 2

Views: 278

Answers (1)

user4151918
user4151918

Reputation:

A search bar is an integral part of UISearchController. It's not possible to use a search controller without a search bar.

One way to display matching usernames would be with a popover that presents a list of matches using a tableView controller. The user could scroll through the list of matches and tap the desired username. Many Twitter clients use this approach.

Upvotes: 1

Related Questions