在iOS中实现自动完成 [英] Implementing Autocomplete in iOS

查看:130
本文介绍了在iOS中实现自动完成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创造,我需要实现自动完成,当用户正在输入到一个文本输入,与出现下面的文本字段中的10就近/排名最高的单词的应用程序。

I am creating an application where I need to implement autocompletion when a user is typing into an text input, with the 10 nearest/highest ranking words appearing below the text field.

我已经得到的的约80000字一个相当大名单及其各自的优先 - 一些决定取决于数量的大小,他们有多高出现在自动完成,像这样的:

I've been given a fairly big list of around 80,000 words and their respective 'priority' - a number which determines how high up they appear in the autocomplete depending on the size of the number, like this:

"transport international";19205
"taxi";18462
"location de voitures";18160
"police";18126
"formation";17858

我还挺新的iOS开发,并想知道什么是做到这一点的最好办法 - 我应该拆分80,000短语成更小的文件,或者只是保持在一个?什么是快?

I am kinda new to iOS development and was wondering what is the best way to do this - should I split the 80,000 phrases into smaller files, or just keep it in one? What would be faster?

我已经看到了针对iOS的例子中使用自动完成,但它是一个非常少量的建议 - 我还没有看到它这样做的大前使用的文件,很明显,我想使它尽可能快为增加用户体验。

I have seen autocompletion used in an example for iOS but it was for a very small amount of suggestions - I haven't seen it done using a file this large before, and obviously I would like to make it as fast as possible for added user experience.

任何建议例子,教程或code建议将不胜AP preciated,谢谢。

Any suggestions as to examples, tutorials or code suggestions would be greatly appreciated, thanks.

推荐答案

您可能希望使用此回购 HTAutocompleteTextField ,完美的解决方案

You may want to use this repo HTAutocompleteTextField, perfect solution.

这篇关于在iOS中实现自动完成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆