测试已测试 | ✓ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最新发布 | 2018年1月 |
SwiftSwift 版本 | 4.0 |
SPM支持 SPM | ✗ |
由 Robert Mogos 和 vladislav 维护。
由 Algolia 提供。
InstantSearch 系列: InstantSearch iOS | InstantSearch Android | React InstantSearch | InstantSearch.js。
InstantSearch iOS 是一个库,提供了小部件和助手,帮助您在 iOS 上使用 Algolia 构建最佳即时搜索体验。它基于 Algolia 的 Swift API 客户端 构建在高级解决方案上,以提供快速构建各种搜索界面的高级解决方案。
您可以在我们的 示例仓库 中看到 InstantSearch iOS 的实际应用,其中我们发布了使用 InstantSearch 和 Swift 编写的示例应用程序。
您可以从 入门指南 开始。
在 专门的文档网站 上了解 InstantSearch iOS 的更多信息。
在您的 AppDelegate.swift
import InstantSearch
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Configure InstantSearch
InstantSearch.shared.configure(appID: "latency", apiKey: "1f6fd3a6fb973cb08419fe7d288fa4db", index: "bestbuy_promo")
}
在您的 ViewController.swift
import InstantSearch
override func viewDidLoad() {
super.viewDidLoad()
let searchBar = SearchBarWidget(frame: CGRect(x: 20, y: 30, width: 300, height: 40))
let statsWidget = StatsLabelWidget(frame: CGRect(x: 20, y: 80, width: 300, height: 50))
self.view.addSubview(searchBar)
self.view.addSubview(statsWidget)
// Add all widgets in view to InstantSearch
InstantSearch.shared.registerAllWidgets(in: self.view)
}
运行您的应用程序,您将获得最基本的应用搜索体验:每次输入查询时,都会显示结果的 UISearchBar
。
为了获得更有意义的搜索体验,请参阅我们的 入门指南。
InstantSearch iOS 是 MIT 许可的。