{"id":22751834,"url":"https://github.com/boraseoksoon/bsautocomplete","last_synced_at":"2025-04-14T13:57:01.147Z","repository":{"id":56903261,"uuid":"171612156","full_name":"boraseoksoon/BSAutocomplete","owner":"boraseoksoon","description":"BSAutocomplete","archived":false,"fork":false,"pushed_at":"2019-11-22T14:23:35.000Z","size":66,"stargazers_count":13,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-28T03:03:22.491Z","etag":null,"topics":["autocomplete","bsautocomplete","cocoa-touch","cocoapods","customui","hashtag","hashtags","ios","library","parse","parser","popup","swift","swift4-2","uicollectionview","uitableview","uitextfield","uitextview"],"latest_commit_sha":null,"homepage":null,"language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/boraseoksoon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-02-20T06:12:45.000Z","updated_at":"2023-12-01T07:26:03.000Z","dependencies_parsed_at":"2022-08-21T02:50:12.172Z","dependency_job_id":null,"html_url":"https://github.com/boraseoksoon/BSAutocomplete","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boraseoksoon%2FBSAutocomplete","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boraseoksoon%2FBSAutocomplete/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boraseoksoon%2FBSAutocomplete/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/boraseoksoon%2FBSAutocomplete/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/boraseoksoon","download_url":"https://codeload.github.com/boraseoksoon/BSAutocomplete/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248893554,"owners_count":21179044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autocomplete","bsautocomplete","cocoa-touch","cocoapods","customui","hashtag","hashtags","ios","library","parse","parser","popup","swift","swift4-2","uicollectionview","uitableview","uitextfield","uitextview"],"created_at":"2024-12-11T05:07:36.352Z","updated_at":"2025-04-14T13:57:01.125Z","avatar_url":"https://github.com/boraseoksoon.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BSAutocomplete\n\n[![CI Status](https://img.shields.io/travis/boraseoksoon/BSAutocomplete.svg?style=flat)](https://travis-ci.org/boraseoksoon/BSAutocomplete)\n[![Version](https://img.shields.io/cocoapods/v/BSAutocomplete.svg?style=flat)](https://cocoapods.org/pods/BSAutocomplete)\n[![License](https://img.shields.io/cocoapods/l/BSAutocomplete.svg?style=flat)](https://cocoapods.org/pods/BSAutocomplete)\n[![Platform](https://img.shields.io/cocoapods/p/BSAutocomplete.svg?style=flat)](https://cocoapods.org/pods/BSAutocomplete)\n\nBSAutocomplete provides easy-to-use and powerful autocomplete feature based on the full screen experience.\u003cbr\u003e\nWith prefix you would like to such as '#', '@' or '$', you can inject stylish full-screen autocomplete functionality into UITextView or UITextField so as to help users better find and write specific contents containing the prefix while typing.\u003cbr\u003e\n\n\u003cimg src=\"https://media.giphy.com/media/bE3Olvp3azcW8qxAJu/giphy.gif\" width=320\u003e\n\nIt's like in this example project: \u003cbr\u003e\n\u003cimg src=\"https://firebasestorage.googleapis.com/v0/b/dayz-dev.appspot.com/o/bsautocomplete_screenshot.png?alt=media\u0026token=aae319a9-2a58-4a2e-822f-3153a6f34ecd\" width=240\u003e\n\u003cbr\u003e\n\nBSAutocomplete is heavily used in ['All DAYZ'](https://itunes.apple.com/app/id1434294288) application.\u003cbr\u003e\nIt's like in 'ALL DAYZ': \u003cbr\u003e\n\u003cimg src=\"https://firebasestorage.googleapis.com/v0/b/dayz-dev.appspot.com/o/alldayz_screenshot.png?alt=media\u0026token=eb5a5d25-d29c-4780-99af-48e05b784c6f\" width=320\u003e\n\u003cbr\u003e\n\nYoutube video URL Link for how it works: \u003cbr\u003e\n[link0](https://www.youtube.com/watch?v=l_FbmPHrbBI), [link1](https://www.youtube.com/watch?v=uOJv1TJQAyA)\n\n\u003cbr\u003e\n\n## Example\n\nTo run the example project, clone the repo, and run `pod install` from the Example directory first.\n\n## Requirements\n\niOS 10.0+ \u003cbr\u003e\nSwift 4.2 + \u003cbr\u003e\n\n## How to use\n\n\u003cb\u003eStep 0. import BSAutocomplete\u003c/b\u003e\n\u003cbr\u003e\u003cbr\u003e\n\n```Swift\nimport BSAutocomplete\n```\n\u003cbr\u003e\n\n\u003cb\u003eStep 1. Create Instance programmatically as an instance variable \u003c/b\u003e\n\u003cbr\u003e\nDeclare and create instance as an instance variable as below.\n\u003cbr\u003e\nBSAutocomplete is only supported in a programmatical way.\n\u003cbr\u003e\u003cbr\u003e\n\n```Swift\n/**\n* Creating BSAutocomplete instance..\n*/\n\n///\n/// - parameter basedOn: a targetView to be based on for which it is usually self.view of UIViewController's instnace. \n/// - parameter prefix: a prefix string to provoke an instance of BSAutocomplete into showing and being hidden. For example, it could be '#', '@' or '$'. \n/// - parameter data: a list of string for you to display, to be shown by an instance of BSAutocomplete.\n/// - returns: BSAutocomplete instance\n\nprivate lazy var autocomplete: BSAutocomplete = { [unowned self] in\n  let autocomplete = BSAutocomplete(basedOn: self.view, prefix: Prefix.at.rawValue, data: hashtags)\n  autocomplete.delegate = self\n\n  return autocomplete\n}()\n\n```\n\u003cbr\u003e\n\u003cb\u003eStep 1. declare BSAutocomplete's delegate in order to keep track of events that will be given by BSAutocomplete at the certain circumstances.\u003c/b\u003e\n\u003cbr\u003e\nYou will be able to assume when to be invoked by looking over the naming of delegate methods. \n\u003cbr\u003e\u003cbr\u003e\n\n```Swift\nextension ViewController: BSAutocompleteDelegate {\n  func autoCompleteDidChooseItem(text: String, sender: Either\u003cUITextView, UITextField\u003e) -\u003e Void {\n    print(\"autoCompleteDidChooseItem : \", text)\n  }\n\n  func autoCompleteTextDidChange(text: String, sender: Either\u003cUITextView, UITextField\u003e) -\u003e Void {\n    print(\"autoCompleteTextDidChange : \", text)\n  }\n\n  func autoCompleteDidShow(sender: Either\u003cUITextView, UITextField\u003e) -\u003e Void {\n    print(\"autoCompleteDidShow\")\n  }\n\n  func autoCompleteDidHide(sender: Either\u003cUITextView, UITextField\u003e) -\u003e Void {\n    print(\"autoCompleteDidHide!\")\n  }\n}\n\n```\n\n\u003cbr\u003e\n\u003cb\u003eStep 2. In viewDidLoad, apply readyToUse() method to get ready to show BSAutocomplete.\u003c/b\u003e\n\u003cbr\u003e\nIt must be done before the use. Do it just as below.  \n\u003cbr\u003e\u003cbr\u003e\n\n```Swift\noverride func viewDidLoad() {\n  super.viewDidLoad()\n\n  /**\n  * Must apply this API in viewDidLoad or similar appropriate method time being called\n  * before the use of BSAutocomplete's instance.\n  */\n  autocomplete.readyToUse()\n}\n\n```\n\n\u003cbr\u003e\n\u003cb\u003eStep 3. add the code below to keep track of observing a current text being typed.\u003c/b\u003e\n\u003cbr\u003e\nApply the below API to observe the text being input.\u003cbr\u003e\nPut a one of string being typed latest into currentUserInput parameter along with which you also need to provide an instance where text input is being input, wrapped by Either type provided by the library, which is either UITextfield or UITextView.\u003cbr\u003e\nYou must need to use this API. Otherwise, an instance of BSAutocomplete has no chance to become visible. \n\u003cbr\u003e\u003cbr\u003e\n\n```Swift\n// MARK: - UITextFieldDelegate Methods -\nextension ViewController: UITextFieldDelegate {\n  func textField(_ textField: UITextField, shouldChangeCharactersIn range: NSRange, replacementString string: String) -\u003e Bool {\n    /**\n    * Must apply this API to keep track of the text being written.\n    */\n    autocomplete.observe(currentUserInput: string, from: .textField(textField))\n    \n    return true\n  }\n}\n\n// MARK: - UITextViewDelegate Methods -\nextension ViewController: UITextViewDelegate {\nfunc textView(_ textView: UITextView, shouldChangeTextIn range: NSRange, replacementText text: String) -\u003e Bool {\n  /**\n  * Must apply this API to keep track of the text being written.\n  */\n  autocomplete.observe(currentUserInput: text, from: .textView(textView))\n  \n  return true\n}\n\n```\n\n\u003cbr\u003e\u003cbr\u003e\n\u003cb\u003eThat's all! Just enjoy BSAutocomplete! :)\u003c/b\u003e\n\u003cbr\u003e\n\n## Credits\nBSAutocomplete is built heavily based on ['Ramotion/reel-search'](https://github.com/Ramotion/reel-search) that draws Core UI of BSAutocomplete.\u003cbr\u003e\n(Mind that reel-search used in BSAutocomplete has been so customized slightly that it is different if you want to clone it.)\n\n## Installation\n\nWe recommend using CocoaPods to install the library.\u003cbr\u003e\nBSAutocomplete is available through [CocoaPods](https://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod 'BSAutocomplete'\n```\n\n## Author\n\nboraseoksoon@gmail.com\n\n## License\n\nBSAutocomplete is available under the MIT license. See the LICENSE file for more info.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboraseoksoon%2Fbsautocomplete","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fboraseoksoon%2Fbsautocomplete","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fboraseoksoon%2Fbsautocomplete/lists"}