{"id":23082574,"url":"https://github.com/datt1994/dptagtextview","last_synced_at":"2025-12-12T06:20:48.063Z","repository":{"id":56907796,"uuid":"128161503","full_name":"Datt1994/DPTagTextView","owner":"Datt1994","description":"Add \u0026 detect Tag/mention and tag search for Textview. ","archived":false,"fork":false,"pushed_at":"2022-08-18T14:56:47.000Z","size":13903,"stargazers_count":38,"open_issues_count":4,"forks_count":13,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-04T19:49:13.672Z","etag":null,"topics":["mention","mention-detection","mention-people","mentionsedittext","search","string-detection","string-matching","swift","tag-detection","tag-search","tag-textview","tags","tagview","textview","uitextview"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Datt1994.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":"2018-04-05T05:05:22.000Z","updated_at":"2025-02-02T11:02:29.000Z","dependencies_parsed_at":"2022-08-21T03:50:15.366Z","dependency_job_id":null,"html_url":"https://github.com/Datt1994/DPTagTextView","commit_stats":null,"previous_names":["datt1994/dptagdetectiontextview"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/Datt1994/DPTagTextView","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPTagTextView","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPTagTextView/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPTagTextView/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPTagTextView/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Datt1994","download_url":"https://codeload.github.com/Datt1994/DPTagTextView/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Datt1994%2FDPTagTextView/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270651073,"owners_count":24622443,"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","status":"online","status_checked_at":"2025-08-15T02:00:12.559Z","response_time":110,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["mention","mention-detection","mention-people","mentionsedittext","search","string-detection","string-matching","swift","tag-detection","tag-search","tag-textview","tags","tagview","textview","uitextview"],"created_at":"2024-12-16T14:54:59.939Z","updated_at":"2025-12-12T06:20:47.995Z","avatar_url":"https://github.com/Datt1994.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DPTagTextView\n[![Platform](https://img.shields.io/cocoapods/p/DPTagTextView.svg?style=flat)](http://cocoapods.org/pods/DPTagTextView)\n[![Language: Swift 5](https://img.shields.io/badge/language-swift5-f48041.svg?style=flat)](https://developer.apple.com/swift)\n[![License](https://img.shields.io/cocoapods/l/DPOTPView.svg?style=flat)](https://github.com/Datt1994/DPTagTextView/blob/master/LICENSE)\n[![Version](https://img.shields.io/cocoapods/v/DPTagTextView.svg?style=flat)](http://cocoapods.org/pods/DPTagTextView)\n[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n\nAdd \u0026 detect tag/mention using Textview.\n\n\u003c!--\u003cimg src=\"https://user-images.githubusercontent.com/19645535/109400852-14133300-7971-11eb-9301-6d8321fbf5b3.mp4\" srcold=\"https://user-images.githubusercontent.com/19645535/109400040-5f771280-796c-11eb-86a4-6a5f12ee13c7.mp4\" width=\"400\" /\u003e--\u003e\n\n![Demo](https://user-images.githubusercontent.com/19645535/109461826-ba059100-7a88-11eb-94db-a5f6b9a746b5.gif)\n\n\n## Installation with CocoaPods\n\n[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C \u0026 Swift. You can install it with the following command:\n\n```bash\n$ gem install cocoapods\n```\n#### Podfile\n\nTo integrate `DPTagTextView` into your Xcode project using CocoaPods, specify it in your `Podfile`:\n\n```ruby\nsource 'https://github.com/CocoaPods/Specs.git'\nplatform :ios, '10.0'\n\ntarget 'TargetName' do\nuse_frameworks!\npod 'DPTagTextView'\nend\n```\n\nThen, run the following command:\n\n```bash\n$ pod install\n```\n\n## Installation with Carthage\n\n[Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks.\n\nYou can install Carthage with [Homebrew](http://brew.sh/) using the following command:\n\n```bash\n$ brew update\n$ brew install carthage\n```\n\nTo integrate `DPTagTextView` into your Xcode project using Carthage, specify it in your `Cartfile`:\n\n```ogdl\ngithub \"Datt1994/DPTagTextView\"\n```\n\nRun `carthage` to build the framework and drag the framework (`DPTagTextView.framework`) into your Xcode project.\n\n## Installation with Swift Package Manager\n\nThe [Swift Package Manager](https://swift.org/package-manager/) is a tool for automating the distribution of Swift code and is integrated into the `swift` compiler.\n\nTo add the library as package dependency to your Xcode project, select File \u003e Swift Packages \u003e Add Package Dependency and enter its repository URL `https://github.com/Datt1994/DPTagTextView.git`\n\n\n## Add Manually \n  \n  Download Project and copy-paste `DPTagTextView.swift` file into your project \n\n\n## How to use\n![AddClass](https://user-images.githubusercontent.com/19645535/42803028-4d108e06-89c2-11e8-9b4a-8cbd92db385d.png)\n\n👆Add DPTagTextView to UITextView Custom Class.\n\n\n## Code\n\n**Set up**\n```swift\ntagTextView.dpTagDelegate = self // set DPTagTextViewDelegate Delegate \ntagTextView.setTagDetection(true) // true :- detecte tag on tap , false :- Search Tags using mentionSymbol \u0026 hashTagSymbol.\ntagTextView.mentionSymbol = \"@\" // Search start with this mentionSymbol.\ntagTextView.hashTagSymbol = \"#\" // Search start with this hashTagSymbol for hashtagging.\ntagTextView.allowsHashTagUsingSpace = true // Add HashTag using space\ntagTextView.textViewAttributes = [NSAttributedString.Key.foregroundColor: UIColor.black,\nNSAttributedString.Key.font: UIFont.systemFont(ofSize: 15)] // set textview defult text Attributes\ntagTextView.mentionTagTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.blue,\nNSAttributedString.Key.backgroundColor: UIColor.lightGray,\nNSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15)] // set textview mentionTag text Attributes\ntagTextView.hashTagTextAttributes = [NSAttributedString.Key.foregroundColor: UIColor.red,\nNSAttributedString.Key.backgroundColor: UIColor.lightGray,\nNSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15)] // set textview hashTag text Attributes\n\n//Set pre text and tags \nlet tag1 = DPTag(name: \"Lorem Ipsum\", range: NSRange(location: 41, length: 11))\nlet tag2 = DPTag(id: \"567681647\", name: \"suffered\", range: NSRange(location: 86, length: 9), data: [\"withHashTag\" : \"#suffered\"], isHashTag: true,customTextAttributes: [NSAttributedString.Key.foregroundColor: UIColor.green,NSAttributedString.Key.backgroundColor: UIColor.black, NSAttributedString.Key.font: UIFont.boldSystemFont(ofSize: 15)])\nlet tag3 = DPTag(name: \"humour\", range: NSRange(location: 133, length: 7), isHashTag: true)\n\ntagTextView.setText(\"There are many variations of passages of Lorem Ipsum available, but the majority have #suffered alteration in some form, by injected #humour, or randomised words which don't look even slightly believable.\", arrTags: [tag1, tag2, tag3])\n\n//Clear textview \ntagTextView.setText(nil, arrTags: [])\n\n//Add tag replacing serached string\n//tagTextView.addTag(allText: String?, tagText: String, id: String, data: [String : Any], customTextAttributes: [NSAttributedString.Key : Any], isAppendSpace: Bool)\ntagTextView.addTag(tagText: \"User Name\")\n```\n\n**Delegate Methods**\n```swift\nextension ViewController : DPTagTextViewDelegate {\n    func dpTagTextView(_ textView: DPTagTextView, didChangedTagSearchString strSearch: String, isHashTag: Bool) {\n    }\n    \n    func dpTagTextView(_ textView: DPTagTextView, didInsertTag tag: DPTag) {\n    }\n    \n    func dpTagTextView(_ textView: DPTagTextView, didRemoveTag tag: DPTag) {\n    }\n    \n    func dpTagTextView(_ textView: DPTagTextView, didSelectTag tag: DPTag) {\n    }\n    \n    func dpTagTextView(_ textView: DPTagTextView, didChangedTags arrTags: [DPTag]) {\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatt1994%2Fdptagtextview","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdatt1994%2Fdptagtextview","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdatt1994%2Fdptagtextview/lists"}