{"id":30559275,"url":"https://github.com/aaronmade/respondabletextfield","last_synced_at":"2025-08-28T09:09:51.509Z","repository":{"id":55499810,"uuid":"322289666","full_name":"aaronmade/RespondableTextField","owner":"aaronmade","description":"Respondable TextField for SwiftUI","archived":false,"fork":false,"pushed_at":"2021-03-24T10:13:37.000Z","size":128,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-17T12:37:10.688Z","etag":null,"topics":["ios","responder","swift","swiftpm","swiftui","textfield"],"latest_commit_sha":null,"homepage":"https://github.com/aaronLab/RespondableTextField","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/aaronmade.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-12-17T12:34:23.000Z","updated_at":"2022-08-22T00:49:28.000Z","dependencies_parsed_at":"2022-08-15T01:50:41.517Z","dependency_job_id":null,"html_url":"https://github.com/aaronmade/RespondableTextField","commit_stats":null,"previous_names":["aaronmade/respondabletextfield"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/aaronmade/RespondableTextField","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronmade%2FRespondableTextField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronmade%2FRespondableTextField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronmade%2FRespondableTextField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronmade%2FRespondableTextField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaronmade","download_url":"https://codeload.github.com/aaronmade/RespondableTextField/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaronmade%2FRespondableTextField/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272475214,"owners_count":24940701,"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-28T02:00:10.768Z","response_time":74,"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":["ios","responder","swift","swiftpm","swiftui","textfield"],"created_at":"2025-08-28T09:09:50.186Z","updated_at":"2025-08-28T09:09:51.483Z","avatar_url":"https://github.com/aaronmade.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Language: Swift 5](https://img.shields.io/badge/language-Swift5-orange?style=flat\u0026logo=swift)](https://developer.apple.com/swift)\n![Platform: iOS 13+](https://img.shields.io/badge/platform-iOS%2013%2B-blue?style=flat\u0026logo=apple)\n![SwiftPM compatible](https://img.shields.io/badge/SPM-compatible-brightgreen?style=flat\u0026logo=swift)\n[![License: MIT](https://img.shields.io/badge/license-MIT-lightgrey?style=flat)](https://github.com/aaronLab/SweetCardScanner/blob/main/LICENSE)\n[![Release version](https://img.shields.io/badge/release-v1.0.2-blue)](https://github.com/aaronLab/RespondableTextField/releases/tag/v1.0.2)\n\n# RespondableTextField\n\n`RespondableTextField` is a simple textField library for SwiftUI. The reason why I wanted to make this library was because I was too lazy to make `UIViewRepresentable`views every single time. Also, I know you were really struggling from, or tired of taking care of UITextFieldDelegate methods, such as `becomeFirstResponder`, `resignFirstResponder`. I really hope this helps you.\n\n\u003cimg src=\"./preview.png\" width=\"260\"\u003e\n\n## Requirements\n\n- iOS 13.0+ (due to SwiftUI)\n\n## Installation\n\n- In Xcode, add the URL of this repository in SwiftPM:\n\n  ```http\n  https://github.com/aaronLab/RespondableTextField.git\n  ```\n\n## Usage\n\n- `import RespondableTextField`\n- Add `RespondableTextField` in your body like below.\n- **_⚠️ To make it work properly: The tags of each RespondableTextField in each body must be increased SEQUENTIALLY in order. ⚠️_**\n\n  ```Swift\n  RespondableTextField(\n    text: Binding\u003cString\u003e,\n    tag: Int,\n    isFirstResponder: Bool = false,\n    placeholder: String? = nil,\n    width: CGFloat? = nil,\n    height: CGFloat? = nil,\n    onEditing: ((String) -\u003e Void)? = nil,\n    didBeginEditing: (() -\u003e Void)? = nil,\n    didEndEditing: (() -\u003e Void)? = nil,\n    shouldReturn: ((String?) -\u003e Void)? = nil\n  )\n  ```\n\n- Also, you don't have to fill all of the optional parameters or `isFirstResponder`.\n- You can make the textField the first responder with `isFirstResponder = true`.\n\n## Extensions\n\n- `respondableSecureType()`\n  - Secure type\n- `respondableKeyboardType(_ type: UIKeyboardType)`\n  - Change keyboard type\n- `respondableContentType(_ type: UITextContentType)`\n  - Change content type\n- `respondableCapitalization(_ type: UITextAutocapitalizationType)`\n  - Capitalization change\n- `respondableFont(_ font: UIFont)`\n  - Change font\n- `respondableLineStyle()`\n  - Borderstyle: .line\n- `respondableBezelStyle()`\n  - Borderstyle: .bezel\n- `textFieldStyle\u003cS\u003e(_ style: S) -\u003e some View where S: TextFieldStyle`\n  - Borderstyle: .roundedRect, .none\n\n## Example\n\nYou can use or customize RespondableTextField like below, or [see example file](./Example/Example/ContentView.swift).\n\n```Swift\n//\n//  ContentView.swift\n//  Example\n//\n//  Created by Aaron Lee on 2020-12-17.\n//\n\nimport SwiftUI\nimport RespondableTextField\n\nstruct ContentView: View {\n    // MARK: - PROPERTIES\n\n    @State private var text1: String = \"\"\n    @State private var text2: String = \"\"\n    @State private var text3: String = \"\"\n    @State private var text4: String = \"\"\n\n    // MARK: - BODY\n\n    var body: some View {\n\n        ScrollView(showsIndicators: false) {\n\n            VStack(alignment: .leading, spacing: 30) {\n\n                // Default\n                Group {\n                    Text(\"Default\")\n                        .font(.system(size: 14, weight: .bold, design: .default))\n                    RespondableTextField(text: $text1,\n                                         tag: 0,\n                                         isFirstResponder: true,\n                                         placeholder: \"1st\") { value in\n                        print(\"onEditing: \\(value)\")\n                    } didBeginEditing: {\n                        print(\"didBeginEditing\")\n                    } didEndEditing: {\n                        print(\"didEndEditing\")\n                    } shouldReturn: { value in\n                        print(\"shouldReturn: \\(value ?? \"N/A\")\")\n                    }\n\n                    Text(text1)\n                }\n\n                // SecureType + RectangleLine Border\n                Group {\n                    Text(\"SecureType + RectangleLine Border\")\n                        .font(.system(size: 14, weight: .bold, design: .default))\n                    RespondableTextField(text: $text2,\n                                         tag: 1,\n                                         placeholder: \"2nd\",\n                                         width: 200,\n                                         height: 50) { value in\n                        print(\"onEditing: \\(value)\")\n                    } didBeginEditing: {\n                        print(\"didBeginEditing\")\n                    } didEndEditing: {\n                        print(\"didEndEditing\")\n                    } shouldReturn: { value in\n                        print(\"shouldReturn: \\(value ?? \"N/A\")\")\n                    }\n                    .respondableSecureType()\n                    .respondableLineStyle()\n\n                    Text(text2)\n                }\n\n                // NumberPad + OneTimeCode + Rounded Border\n                Group {\n                    Text(\"NumberPad + OneTimeCode + Rounded Border\")\n                        .font(.system(size: 14, weight: .bold, design: .default))\n                    RespondableTextField(text: $text3,\n                                         tag: 2,\n                                         placeholder: \"3rd\") { value in\n                        print(\"onEditing: \\(value)\")\n                    } didBeginEditing: {\n                        print(\"didBeginEditing\")\n                    } didEndEditing: {\n                        print(\"didEndEditing\")\n                    } shouldReturn: { value in\n                        print(\"shouldReturn: \\(value ?? \"N/A\")\")\n                    }\n                    .respondableKeyboardType(.numberPad)\n                    .respondableContentType(.oneTimeCode)\n                    .textFieldStyle(RoundedBorderTextFieldStyle())\n\n                    Text(text3)\n                }\n\n                // didEndEditing + Bazel Border + Font\n                Group {\n                    Text(\"didBeginEditing + didEndEditing + Bazel Border\")\n                        .font(.system(size: 14, weight: .bold, design: .default))\n                    RespondableTextField(text: $text4,\n                                         tag: 3,\n                                         placeholder: \"4th\") { value in\n                        print(\"onEditing: \\(value)\")\n                    } didBeginEditing: {\n                        print(\"didBeginEditing\")\n                    } didEndEditing: {\n                        print(\"didEndEditing\")\n                    } shouldReturn: { value in\n                        print(\"shouldReturn: \\(value ?? \"N/A\")\")\n                    }\n                    .respondableBezelStyle()\n                    .respondableFont(.systemFont(ofSize: 20, weight: .bold))\n\n                    Text(text4)\n                }\n\n            } //: V\n            .padding()\n        } //: S\n        .preferredColorScheme(.light)\n    }\n}\n\n```\n\n## License\n\nLicensed under [MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronmade%2Frespondabletextfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaronmade%2Frespondabletextfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaronmade%2Frespondabletextfield/lists"}