A custom Swift UITextField with toggleable password visibility and configurable password policy validation.
PasswordTextField is a custom UITextField component for iOS apps, written in Swift. It adds a toggleable icon to show or hide password text and includes built-in validation to enforce password policies like minimum length, uppercase letters, and numbers. It solves the common need for secure, user-friendly password input fields without requiring custom implementations.
iOS developers building apps that require password input, especially those needing enhanced security features or improved UX for password fields.
Developers choose PasswordTextField because it packages essential password field functionality—visibility toggling and validation—into a drop-in component that works with Interface Builder and major dependency managers, saving development time and ensuring consistency.
A custom TextField with a switchable icon which shows or hides the password and enforce good password policies
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Easily drag and drop into storyboards with visual configuration for properties like toggle button display and icon color in the Attribute Inspector, as shown in the screenshot.
Supports default password policies (8 chars, uppercase, number) and custom regex patterns with error messages, demonstrated in the validation code examples.
Allows setting when the visibility icon appears—while editing, always, or never—via Interface Builder or code, enhancing user experience.
Compatible with Swift Package Manager, CocoaPods, Carthage, and manual installation, making it adaptable to various project setups.
The README's TODO list admits missing animations for toggling and no indication for password strength, limiting modern UX expectations.
Designed for UIKit, so it lacks native SwiftUI support, requiring extra work for integration in contemporary iOS apps.
Validation is restricted to regex patterns, which may not suffice for complex or server-side password policy checks without custom extensions.