{"id":18031752,"url":"https://github.com/dagronf/dsfsecuretextfield","last_synced_at":"2025-03-27T05:30:57.110Z","repository":{"id":63907296,"uuid":"231382175","full_name":"dagronf/DSFSecureTextField","owner":"dagronf","description":"NSSecureTextField with a 'visibility' button.","archived":false,"fork":false,"pushed_at":"2024-10-06T22:53:49.000Z","size":70,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T04:31:39.712Z","etag":null,"topics":["macos","nssecuretextfield","password","swift"],"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/dagronf.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-02T12:55:46.000Z","updated_at":"2025-01-24T06:43:23.000Z","dependencies_parsed_at":"2024-10-30T10:21:13.929Z","dependency_job_id":null,"html_url":"https://github.com/dagronf/DSFSecureTextField","commit_stats":{"total_commits":9,"total_committers":1,"mean_commits":9.0,"dds":0.0,"last_synced_commit":"95f00cd25451a37bfc4e91e28d30fa2371d89f31"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSecureTextField","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSecureTextField/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSecureTextField/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dagronf%2FDSFSecureTextField/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dagronf","download_url":"https://codeload.github.com/dagronf/DSFSecureTextField/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245791340,"owners_count":20672665,"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":["macos","nssecuretextfield","password","swift"],"created_at":"2024-10-30T10:10:39.654Z","updated_at":"2025-03-27T05:30:56.570Z","avatar_url":"https://github.com/dagronf.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DSFSecureTextField\n\nNSSecureTextField with a 'visibility' button.\n\n![](https://img.shields.io/github/v/tag/dagronf/DSFSecureTextField) ![](https://img.shields.io/badge/macOS-10.13+-red) ![](https://img.shields.io/badge/Swift-5.0-orange.svg)\n![](https://img.shields.io/badge/License-MIT-lightgrey) [![](https://img.shields.io/badge/pod-compatible-informational)](https://cocoapods.org) [![](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)\n\n## Why\n\nSometimes it's nice to be able to see the contents of a password field. `DSFSecureTextField` adds a visibility button to the existing `NSSecureTextField` allowing your users to show or hide the contents of the field.\n\nOptionally, you can choose to dynamically remove the button from the control (for example, if you want to be able to let your users choose whether to show the password or not via a preference)\n\n![](https://github.com/dagronf/dagronf.github.io/raw/master/art/projects/DSFSecureTextField/DSFSecureTextField.gif)\n\n## Integrate\n\n* Copy the file `DSFSecureTextField.swift` into your project\n* Or, use CocoaPods\n\n\t`pod 'DSFSecureTextField', :git =\u003e 'https://github.com/dagronf/DSFSecureTextField/'`\n\t\n* Or, use Swift Package Manager\n\n## Usage\n\n### Interface builder\n\n1. Drag a Secure Text Field into the canvas\n2. Set the `Custom Class` field for the control to `DSFSecureTextField`\n3. Done!\n\n### Code\n\nSince `DSFSecureTextField` inherits from `NSSecureTextField`, you can create it exactly as you would for an `NSSecureTextField`\n\n### Demo\n\nThere is a very simple project in the `Demos` folder.\n\n## Configuration\n\n| Parameter                    | Type         | Description                                                 |\n|:-----------------------------|:------------:|:------------------------------------------------------------|\n| `allowPasswordInPlainText`   | `Bool`       | If true, *allows* the control to display a plain text representation of the password. Useful if you want to be able to control whether the user can choose (eg. via preferences) to make the password visible. |\n| `displayToggleButton`        | `Bool`       | If true, displays a button _within_ the control (an eye) to allow the user to toggle between secure and plain text input |\n| `visibility`                 | `Visibility` | If `.plainText`, the password is displayed in plain text.   |\n\n### `allowPasswordInPlainText`\n\nA boolean flag to indicate if the field is allowed to display passwords in plain text.  \n\nIf true, *allows* the control to display a plain text representation of the password. Useful if you want to be able \nto control whether the user can choose (eg. via preferences) to make the password visible. \n\n### `displayToggleButton`\n\nWhen true, displays an 'eye' button embedded within the password field that allows the user to toggle the visibility\nof the password. \n\n* If true, displays a button _within_ the control (an eye) to allow the user to toggle between secure and plain text input\n* If false (and `allowPasswordInPlainText` is true), the application needs to provide its own mechanism for setting \n`visibility` as appropriate. \n\n### `visibility`\n\nThe visibility flag denotes the visibility of the text within the field\n\n| Value        | Description   |\n|--------------|:--------------|\n| `.secure`    | The content is displayed securely (eg. `●●●●●●●●`) |\n| `.plainText` | The content is displayed in plain text (eg. `gr00vy!.`) |\n\n## License\n\n```\nMIT License\n\nCopyright (c) 2023 Darren Ford\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfsecuretextfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdagronf%2Fdsfsecuretextfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdagronf%2Fdsfsecuretextfield/lists"}