A Swift library for formatting and validating user input in iOS/macOS text fields with masks for phone numbers, dates, and more.
Input Mask is a Swift library for iOS and macOS that formats and validates user input in real-time using customizable masks. It solves the problem of guiding users to enter correctly formatted data—such as phone numbers, dates, or credit card numbers—by restricting input and filtering unnecessary characters.
iOS and macOS developers building apps that require structured data entry, such as forms, payment interfaces, or registration flows.
Developers choose Input Mask for its robust mask syntax, support for international formats, and seamless integration with UIKit, SwiftUI, and macOS. It’s a mature library with extensive documentation and active maintenance.
User input masking library repo.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports custom mask definitions like `[0000] [0000] [0000] [0000]` for credit cards, enabling precise formatting for diverse data types as shown in the examples.
Automatically detects country codes from entered digits and applies corresponding formatting restrictions, useful for global apps as highlighted in the features.
Extends functionality to modern SwiftUI and macOS applications, ensuring cross-platform usability per the README's compatibility notes.
Regular updates indicated by Swift Package Index badges and GitHub actions, showing ongoing development and community support.
Disrupts standard UITextField notifications and editingChanged events, requiring workarounds like custom delegate subclasses as admitted in the known issues section.
Fails to copy text to the pasteboard during cut operations due to library design, necessitating invasive patches such as UITextField subclassing.
Causes problems with Interface Builder when used as a Carthage-built dynamic framework, limiting storyboard integration and requiring radar filings or workarounds.