How to search a UITableView

2020-05-24 09:38发布

问题:

Right so I know there are about a billion questions on SO about this subject, but they all appear to link to the same old blog posts about implementing a UISearchBar, or Apple docs. What I want to know is, is there a proper tutorial out there for implementing the UISearchDisplayController class to search through either an array/dictionary and update a UITableView based on that?

I've followed about 10 different variations of tutorial on this topic and none of them yield the expected result. Some tutorials simply show you one line of code and expect you to figure it out, so all I'm asking if is there a tutorial out there which goes through step by step how to to implement search functionality within an iOS app?

Heck if I figure this out eventually I might write a tutorial myself!

Thanks in advance guys.

回答1:

Check the blogs post and try to understand how they have used,May be,you would require to modify to fit under requirement,Assume the articles are more than sufficient to understand and using UISearchDisplayController .

iPhone/iPad UISearchBar and UISearchDisplayController Asynchronous Example

Cancellable asynchronous searching with UISearchDisplayController

A simple tutorial of UISearchDisplayerController