简体   繁体   中英

How to best use UISearchBar to search using API call, iOS

I have a huge list of elements, and only 50 is shown in table view through API paging. There is a search bar with the table view. When someone searches using the search bar, I need to use a search API. Is there a way to make this just like normal search experience as you would search through the table view elements per key press.

In case you want search to work with API call, you can follow the concept of reloading data after every few characters are typed (example : every 3 characters typed) in textDidChange method of UISearchBar.

Alternatively data can be reloaded when user stops typing. Refer to link in order to follow this approach.

By reloading, I mean the method which will actually perform the stuff you want to do after the user stops typing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM