使用swift 3中的UISearchBar / UISearchController进行即时搜索

时间:2023-01-12 18:05:03

I am trying to add the instant search functionality into my existing controller using the UISearchBar or UISearchController

我正在尝试使用UISearchBar或UISearchController将即时搜索功能添加到现有控制器中

  • When user enters 3 characters on searchbar, should start fetching the data & show in the tableview. For that I added the API call on searchBar Delegate, but it takes time to fetch the data , while user again start entering the data, each time user enters a character , it hits one api.

    当用户在搜索栏上输入3个字符时,应该开始获取数据并在tableview中显示。为此,我在searchBar Delegate上添加了API调用,但是获取数据需要时间,而用户再次开始输入数据,每次用户输入一个字符时,它就会命中一个api。

What approach should we follow to achieve it ?

我们应该采取什么方法来实现它?

Is there any good library or open source to do it?

有没有好的图书馆或开源来做呢?

1 个解决方案

#1


4  

You can use InstantSearch iOS, which is an open-source library providing UI components to help you easily build instant search experiences on iOS with Algolia.

您可以使用InstantSearch iOS,它是一个开源库,提供UI组件,帮助您轻松地在iOS上使用Algolia构建即时搜索体验。

It is available on GitHub. See for example the InstantSearch E-commerce app:

它可以在GitHub上找到。例如,查看InstantSearch电子商务应用:

使用swift 3中的UISearchBar / UISearchController进行即时搜索

You can start with the Getting Started Guide which will take you through the main steps to use the library.

您可以从“入门指南”开始,该指南将指导您完成使用该库的主要步骤。

The example application is also a great addition to the guide as it’ll help you get an idea of what you can build with InstantSearch iOS.

示例应用程序也是本指南的一个很好的补充,因为它可以帮助您了解使用InstantSearch iOS构建的内容。

Disclaimer: I am the author of InstantSearch iOS

免责声明:我是InstantSearch iOS的作者

#1


4  

You can use InstantSearch iOS, which is an open-source library providing UI components to help you easily build instant search experiences on iOS with Algolia.

您可以使用InstantSearch iOS,它是一个开源库,提供UI组件,帮助您轻松地在iOS上使用Algolia构建即时搜索体验。

It is available on GitHub. See for example the InstantSearch E-commerce app:

它可以在GitHub上找到。例如,查看InstantSearch电子商务应用:

使用swift 3中的UISearchBar / UISearchController进行即时搜索

You can start with the Getting Started Guide which will take you through the main steps to use the library.

您可以从“入门指南”开始,该指南将指导您完成使用该库的主要步骤。

The example application is also a great addition to the guide as it’ll help you get an idea of what you can build with InstantSearch iOS.

示例应用程序也是本指南的一个很好的补充,因为它可以帮助您了解使用InstantSearch iOS构建的内容。

Disclaimer: I am the author of InstantSearch iOS

免责声明:我是InstantSearch iOS的作者