{"id":2931,"url":"https://github.com/alexruperez/ARAutocompleteTextView","last_synced_at":"2025-08-03T12:31:42.077Z","repository":{"id":11116219,"uuid":"13473866","full_name":"alexruperez/ARAutocompleteTextView","owner":"alexruperez","description":"ARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time.  This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @alexruperez.","archived":false,"fork":false,"pushed_at":"2019-10-26T11:34:55.000Z","size":212,"stargazers_count":263,"open_issues_count":5,"forks_count":27,"subscribers_count":14,"default_branch":"master","last_synced_at":"2024-11-07T07:52:52.605Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","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/alexruperez.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":"2013-10-10T14:37:04.000Z","updated_at":"2024-06-06T22:24:26.000Z","dependencies_parsed_at":"2022-09-04T06:21:07.038Z","dependency_job_id":null,"html_url":"https://github.com/alexruperez/ARAutocompleteTextView","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/alexruperez%2FARAutocompleteTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FARAutocompleteTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FARAutocompleteTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexruperez%2FARAutocompleteTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexruperez","download_url":"https://codeload.github.com/alexruperez/ARAutocompleteTextView/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228543197,"owners_count":17934444,"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":[],"created_at":"2024-01-05T20:16:26.655Z","updated_at":"2024-12-07T00:31:06.095Z","avatar_url":"https://github.com/alexruperez.png","language":"Objective-C","readme":"\n# ARAutocompleteTextView\n[![Twitter](http://img.shields.io/badge/contact-@alexruperez-blue.svg?style=flat)](http://twitter.com/alexruperez)\n[![GitHub Issues](http://img.shields.io/github/issues/alexruperez/ARAutocompleteTextView.svg?style=flat)](http://github.com/alexruperez/ARAutocompleteTextView/issues)\n[![Version Status](http://img.shields.io/cocoapods/v/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView)\n[![License Status](http://img.shields.io/cocoapods/l/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView)\n[![Platform Status](http://img.shields.io/cocoapods/p/ARAutocompleteTextView.svg?style=flat)](http://cocoadocs.org/docsets/ARAutocompleteTextView)\n[![Analytics](https://ga-beacon.appspot.com/UA-55329295-1/ARAutocompleteTextView/readme?pixel)](https://github.com/igrigorik/ga-beacon)\n\n## Overview\n\nARAutocompleteTextView is a subclass of UITextView that automatically displays text suggestions in real-time.  This is perfect for automatically suggesting the domain as a user types an email address, #hashtag or @handle.\n\n\u003cimg src=\"https://raw.github.com/alexruperez/ARAutocompleteTextView/master/ARTextViewAutocompletion.png\" alt=\"ARTextViewAutocompletion\" title=\"ARAutocompleteTextView\" style=\"display:block; margin: 10px auto 30px auto; align:center\"\u003e\n\n# Usage\n\n## Installation\n\n### Add the following files to your project:\n* `ARAutocompleteTextView.m`\n* `ARAutocompleteTextView.h`\n* `ARAutocompleteManager.m`\n* `ARAutocompleteManager.h`\n\n## Quickstart Guide\n\nCreate an `ARAutocompleteTextView` instance exactly as as you would `UITextView`.  You can do eith either programmitcally or in Interface Builder.  Programmatically, this looks like:\n\n##### Objective C\n\n    ARAutocompleteTextView* textField = [[ARAutocompleteTextView alloc] initWithFrame:CGRectMake(0,0,100,31)];\n    \n##### Swift\n    \n    let textField = ARAutocompleteTextView(frame: CGRectMake(0, 0, 100, 31))\n\n    \n\nThe data source is the brains of the autocomplete logic.  If you just want to autocomplete email addresses, #hashtags or @handles, use `ARAutocompleteManager` from the example project as follows:\n\n##### Objective-C\n    textField.autocompleteDataSource = [ARAutocompleteManager sharedManager];\n    textField.autocompleteType = ARAutocompleteTypeEmail;\n    \n##### Swift\n    textField.autocompleteDataSource = ARAutocompleteManager.sharedManager()\n    textField.autocompleteType = ARAutocompleteType.Mail\n\n\n## Customization\n\n### Autocompletion Data Source\n\n`ARAutocompleteManager` (included in the example project) provides email address autocompletion out of the box.  It comes with a list of the top email domains.  You may want to tailor this list of email domains to match your own customers, or you may want to write autocomplete logic for a different type of text view (in the demo, names of colors are autocompleted).\n\nAlternatively, you may wish to create your own data source class and user the `autocompleteType` property to differentiate between textviews with different data types.  A `ARAutocompleteTextView`'s data source must implement the following method, as part of the `ARAutocompleteDataSource` protocol.\n\n    - (NSString *)textField:(ARAutocompleteTextView*)textField completionForPrefix:(NSString *)prefix\n\nYou may also set a default `dataSource` for all instances of `ARAutocompleteTextView`.  In the example project, we use a `ARAutocompleteManager` singleton:\n\n     [autocompleteTextOffset setDefaultAutocompleteDataSource:[ARAutocompleteManager sharedManager]];\n\n### Positioning and Formatting\n\nTo adjust the position of the autocomplete label by a fixed amount, set `autocompleteTextOffset`:\n\n    textField.autocompleteTextOffset = CGPointMake(10.0, 10.0);\n\nFor more dynamic positioning of the autocomplete label, subclass `ARAutocompleteTextView` and override `- (CGRect)autocompleteRectForBounds:(CGRect)bounds`.\n\nTo adjust the properties (i.e. `font`, `textColor`) of the autocomplete label, do so via the `[AutocompleteTextField autocompleteLabel] property.\n\n    textField.autocompleteLabel.textColor = [UIColor grayColor];\n\n## Event Listening\n\nIn addition to observing the standard `UITextView` notifications (i.e. `UITextViewTextDidChangeNotification` and friends), you can use `[ARAutocompleteTextView autoCompleteTextFieldDelegate]` to listen for certain events.  This is particularly useful if you are collecting analytics.\n\n# Etc.\n\n* Use this in your apps whenever you can, particularly email addresses -- your users will appreciate it!\n* Contributions are very welcome.\n* Attribution is appreciated (let's spread the word!), but not mandatory.\n\n## Use it? Love/hate it?\n\nTweet the author @alexruperez, and check out alexruperez's blog: http://alexruperez.com\n\n## Other Links\n\n[code4app Review](http://code4app.net/ios/ARAutocompleteTextView/528d8d86cb7e8464178b4e35)\n\n[Cocoa Controls](http://cocoacontrols.com/controls/arautocompletetextview)\n","funding_links":[],"categories":["UI","Uncategorized"],"sub_categories":["TextField \u0026 TextView","Layout","Other free courses","Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruperez%2FARAutocompleteTextView","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexruperez%2FARAutocompleteTextView","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexruperez%2FARAutocompleteTextView/lists"}