{"id":2977,"url":"https://github.com/ChiliLabs/CHIOTPField","last_synced_at":"2025-08-06T16:31:52.991Z","repository":{"id":41164619,"uuid":"266802612","full_name":"ChiliLabs/CHIOTPField","owner":"ChiliLabs","description":"CHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. Mady by @ChiliLabs - https://chililabs.io","archived":false,"fork":false,"pushed_at":"2020-12-02T08:01:39.000Z","size":13237,"stargazers_count":276,"open_issues_count":7,"forks_count":20,"subscribers_count":11,"default_branch":"master","last_synced_at":"2024-12-09T14:49:51.743Z","etag":null,"topics":[],"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/ChiliLabs.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":"2020-05-25T14:37:19.000Z","updated_at":"2024-11-18T09:57:23.000Z","dependencies_parsed_at":"2022-09-08T02:36:22.889Z","dependency_job_id":null,"html_url":"https://github.com/ChiliLabs/CHIOTPField","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChiliLabs%2FCHIOTPField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChiliLabs%2FCHIOTPField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChiliLabs%2FCHIOTPField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChiliLabs%2FCHIOTPField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChiliLabs","download_url":"https://codeload.github.com/ChiliLabs/CHIOTPField/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228923730,"owners_count":17992569,"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:27.948Z","updated_at":"2024-12-09T16:31:11.620Z","avatar_url":"https://github.com/ChiliLabs.png","language":"Swift","funding_links":[],"categories":["UI","Libs","UI [🔝](#readme)"],"sub_categories":["TextField \u0026 TextView","UI"],"readme":"# CHIOTPField\n\nCHIOTPField is a set of textfields that can be used for One-time passwords, SMS codes, PIN codes, etc. All fields support insertion of one-time codes from SMS.\n\nMade with ❤️ by [Chili Labs](https://chililabs.io).\n\n## Overview\n\n\u003cimg src=\"Gif/preview.gif\" width=\"500\" height=\"164\" /\u003e\n\n## Requirements\n\n* iOS 10.0+\n* Swift 5\n\n## Installation\n\n### Manually\n\nJust add the `Sources` folder to your project.\n\n### CocoaPods\n\nuse [CocoaPods](https://cocoapods.org) with Podfile:\n``` ruby\npod 'CHIOTPField', '~\u003e 0.1'\n\n# individual page control\npod 'CHIOTPField/One'\npod 'CHIOTPField/Two'\npod 'CHIOTPField/Three'\npod 'CHIOTPField/Four'\n```\n\n### Swift Package Manager\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/ChiliLabs/CHIOTPField.git\", .upToNextMajor(from: \"0.1\"))\n]\n```\n\n## Usage\n### 🎨 Storyboards\nJust drop UITextField and set its class to be one of CHIOTPField.\n\u003cimg src=\"Gif/ibdesignable.gif\" width=\"800\" height=\"617\" /\u003e\n### 💻 Code\n``` swift\nlet field = CHIOTPFieldOne(frame: .init(x: 0, y: 0, width: 200, height: 60))\nfield.numberOfDigits = 4\nfield.cornerRadius = 4\n```\n\n### Text Color\nJust change the text color for textfield as you normaly do.\n\n### Caret color\nTint color is responsible for caret color. If you want to hide a caret, just set the color to clear.\n\n## OTP Fields\n### OTPFieldOne\n\u003cimg src=\"Gif/field_1.gif\" width=\"320\" height=\"63\" /\u003e\n\n``` swift\nvar numberOfDigits: Int // number of boxes for digits\nvar spacing: Int // spacing between digits\nvar boxBackgroundColor: UIColor // background color of the box in normal state\nvar borderColor: UIColor // border color of the box in normal state\nvar cornerRadius: CGFloat // corner radius of the box\nvar activeShadowColor: UIColor? // shadow color of the box in active state\nvar activeShadowOpacity: CGFloat // shadow opacity of the box in active state\nvar boxPlaceholder: String? // placeholder text\nvar boxPlaceholderColor: UIColor? // placeholder text color\n```\n\n### OTPFieldTwo\n\u003cimg src=\"Gif/field_2_1.gif\" width=\"320\" height=\"58\" /\u003e\n\u003cimg src=\"Gif/field_2_2.gif\" width=\"320\" height=\"61\" /\u003e\n\n``` swift\nvar numberOfDigits: Int // number of boxes for digits\nvar spacing: Int // spacing between digits\nvar cornerRadius: CGFloat // corner radius of the box\nvar boxBackgroundColor: UIColor // background color of the box in normal state\nvar activeBoxBackgroundColor: UIColor // background color of the box in active state\nvar filledBoxBackgroundColor: UIColor // background color of the box if a text is entered\nvar borderColor: UIColor // border color of the box in normal state\nvar activeBorderColor: UIColor? // border color of the box in active\nvar filledBorderColor: UIColor? // border color of the box if a text is entered\nvar boxPlaceholder: String? // placeholder text\nvar boxPlaceholderColor: UIColor? // placeholder text color\n```\n\n### OTPFieldThree\n\u003cimg src=\"Gif/field_3.gif\" width=\"320\" height=\"67\" /\u003e\n\n``` swift\nvar numberOfDigits: Int // number of boxes for digits\nvar spacing: Int // spacing between digits\nvar boxBackgroundColor: UIColor // background color of the box in normal state\nvar borderHeight: CGFloat / /bottom border height\nvar borderCornerRadius: CGFloat // bottom border radius\nvar dotRadius: CGFloat // dot radius when text is entered\n```\n\n### OTPFieldFour\n\u003cimg src=\"Gif/field_4.gif\" width=\"320\" height=\"73\" /\u003e\n\n``` swift\nvar numberOfDigits: Int // number of boxes for digits\nvar spacing: Int // spacing between digits\nvar boxBackgroundColor: UIColor // background color of the box in normal state\nvar borderHeight: CGFloat / /bottom border height\nvar borderColor: CGFloat // bottom border color\nvar cornerRadius: CGFloat // corner radius of the box\n```\n\n## License\nCHIOTPField is released under the MIT license. See [LICENSE](./LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChiliLabs%2FCHIOTPField","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChiliLabs%2FCHIOTPField","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChiliLabs%2FCHIOTPField/lists"}