{"id":2926,"url":"https://github.com/whitesmith/WSTagsField","last_synced_at":"2025-08-06T16:30:47.210Z","repository":{"id":37444885,"uuid":"62551802","full_name":"whitesmith/WSTagsField","owner":"whitesmith","description":"An iOS text field that represents tags, hashtags, tokens in general.","archived":false,"fork":false,"pushed_at":"2022-10-20T06:32:55.000Z","size":269,"stargazers_count":1285,"open_issues_count":29,"forks_count":227,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-11-20T05:48:06.154Z","etag":null,"topics":["carthage","carthage-installation","cocoapods","hashtag","hashtags","ios","swift","swift-package-manager","tags","ui-components","uitextfield"],"latest_commit_sha":null,"homepage":"","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/whitesmith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["ricardopereira"]}},"created_at":"2016-07-04T09:56:23.000Z","updated_at":"2024-10-29T08:56:41.000Z","dependencies_parsed_at":"2022-07-14T22:30:34.912Z","dependency_job_id":null,"html_url":"https://github.com/whitesmith/WSTagsField","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitesmith%2FWSTagsField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitesmith%2FWSTagsField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitesmith%2FWSTagsField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/whitesmith%2FWSTagsField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/whitesmith","download_url":"https://codeload.github.com/whitesmith/WSTagsField/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923679,"owners_count":17992566,"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":["carthage","carthage-installation","cocoapods","hashtag","hashtags","ios","swift","swift-package-manager","tags","ui-components","uitextfield"],"created_at":"2024-01-05T20:16:26.501Z","updated_at":"2024-12-09T16:30:59.465Z","avatar_url":"https://github.com/whitesmith.png","language":"Swift","funding_links":["https://github.com/sponsors/ricardopereira"],"categories":["UI","Libs","TextField","Swift","UI [🔝](#readme)","swift","User Interface"],"sub_categories":["Tag","UI","Layout","Other free courses","Mobile"],"readme":"# WSTagsField\n\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg)](https://github.com/Carthage/Carthage)\n[![SwiftPM Compatible](https://img.shields.io/badge/SwiftPM-Compatible-brightgreen.svg)](https://swift.org/package-manager/)\n[![CocoaPods Compatible](https://img.shields.io/cocoapods/v/WSTagsField.svg)](https://cocoapods.org/pods/WSTagsField)\n[![Swift 5.1](https://img.shields.io/badge/Swift-5.1-orange.svg?style=flat)](https://developer.apple.com/swift/)\n[![Platforms iOS](https://img.shields.io/badge/Platforms-iOS-lightgray.svg?style=flat)](http://www.apple.com/ios/)\n[![Build Status](https://app.bitrise.io/app/059bc89743c769dc/status.svg?token=Wu0zdJtTsCQlVFSG1XuGIw\u0026branch=master)]()\n[![License MIT](https://img.shields.io/badge/License-MIT-lightgrey.svg?style=flat)](https://opensource.org/licenses/MIT)\n\nAn iOS text field that represents tags, hashtags, tokens in general.\n\n![WSTagsField](http://i.giphy.com/3o72F8JCGkjrF4Lwvm.gif)\n\n## Usage\n\n``` swift\nlet tagsField = WSTagsField()\ntagsField.layoutMargins = UIEdgeInsets(top: 2, left: 6, bottom: 2, right: 6)\ntagsField.contentInset = UIEdgeInsets(top: 10, left: 10, bottom: 10, right: 10)\ntagsField.spaceBetweenLines = 5.0\ntagsField.spaceBetweenTags = 10.0\ntagsField.font = .systemFont(ofSize: 12.0)\ntagsField.backgroundColor = .white\ntagsField.tintColor = .green\ntagsField.textColor = .black\ntagsField.fieldTextColor = .blue\ntagsField.selectedColor = .black\ntagsField.selectedTextColor = .red\ntagsField.delimiter = \",\"\ntagsField.isDelimiterVisible = true\ntagsField.placeholderColor = .green\ntagsField.placeholderAlwaysVisible = true\ntagsField.keyboardAppearance = .dark\ntagsField.returnKeyType = .next\ntagsField.acceptTagOption = .space\ntagsField.shouldTokenizeAfterResigningFirstResponder = true\n\n// Events\ntagsField.onDidAddTag = { field, tag in\n    print(\"DidAddTag\", tag.text)\n}\n\ntagsField.onDidRemoveTag = { field, tag in\n    print(\"DidRemoveTag\", tag.text)\n}\n\ntagsField.onDidChangeText = { _, text in\n    print(\"DidChangeText\")\n}\n\ntagsField.onDidChangeHeightTo = { _, height in\n    print(\"HeightTo\", height)\n}\n\ntagsField.onValidateTag = { tag, tags in\n    // custom validations, called before tag is added to tags list\n    return tag.text != \"#\" \u0026\u0026 !tags.contains(where: { $0.text.uppercased() == tag.text.uppercased() })\n}\n\nprint(\"List of Tags Strings:\", tagsField.tags.map({$0.text}))\n```\n\n## Installation\n\n#### \u003cimg src=\"https://cloud.githubusercontent.com/assets/432536/5252404/443d64f4-7952-11e4-9d26-fc5cc664cb61.png\" width=\"24\" height=\"24\"\u003e [Carthage]\n\n[Carthage]: https://github.com/Carthage/Carthage\n\nTo install it, simply add the following line to your **Cartfile**:\n\n```ruby\ngithub \"whitesmith/WSTagsField\"\n```\n\nThen run `carthage update`.\n\nFollow the current instructions in [Carthage's README][carthage-installation]\nfor up to date installation instructions.\n\n[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application\n\n#### \u003cimg src=\"https://raw.githubusercontent.com/ricardopereira/resources/master/img/cocoapods.png\" width=\"24\" height=\"24\"\u003e [CocoaPods]\n\n[CocoaPods]: http://cocoapods.org\n\nTo install it, simply add the following line to your **Podfile**:\n\n```ruby\npod \"WSTagsField\"\n```\n\nThen run `pod install` with CocoaPods 1.8.0 or newer.\n\n### Swift Package Manager\n\nUsing **Xcode 11**, just go to _\"File\" \u003e \"Swift Packages\" \u003e \"Add Package Dependency...\"_ and use this repository: `https://github.com/whitesmith/WSTagsField`.\n\n### Manually\n\nDownload all the source files and drop them into your project.\n\n## Requirements\n\n* iOS 9.0+\n* Xcode 11 (Swift 5.1)\n\n# Contributing\n\nThe best way to contribute is by submitting a pull request. We'll do our best to respond to your patch as soon as possible. You can also submit a [new GitHub issue](https://github.com/whitesmith/WSTagsField/issues/new) if you find bugs or have questions. :octocat:\n\n# Credits\n![Whitesmith](http://i.imgur.com/Si2l3kd.png)\n\nThis project was inspired by [CLTokenInputView](https://github.com/clusterinc/CLTokenInputView).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitesmith%2FWSTagsField","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwhitesmith%2FWSTagsField","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwhitesmith%2FWSTagsField/lists"}