A lightweight, SwiftUI-first secure numeric keypad built as a Swift Package (SPM).
SmartSecureKeypad provides a fixed 3×4 numpad, a PIN indicator, and opt-in shuffle support — while keeping UI rendering fully customizable from the host app.
✅ You build the UI.
✅ The framework handles input buffering (digit/delete), completion, and optional digit shuffling.
✅ Designed to integrate cleanly with real-world apps.
- 3×4 fixed layout numeric keypad (0–9)
- Custom key rendering via
keyRenderer(most useful in production) - Built-in keys:
.digit(Int)— 0 ~ 9.delete— backspace.shuffle— rearrange/shuffle digit positions (optional).empty— spacer to keep layout fixed
- Input handling built-in:
- Buffers PIN input (
pinbinding) - Handles delete
- Calls
onCompletewhenpin.count == maxLength
- Buffers PIN input (
- Accessibility-friendly labels per key
- PIN progress indicator:
- Default dot style
- Supports dash style for empty slots (for “●●●— — —” style UIs)
- Opt-in lockout helpers (UI utility):
- Remaining time formatter (
mm:ss) - Lockout message view (
TimelineView-based)
- Remaining time formatter (
- iOS 16+
- SwiftUI
File→Add Packages…- Add this repository URL
- Select the
SmartSecureKeypadproduct
dependencies: [
.package(url: "YOUR_REPO_URL_HERE", from: "0.1.0")
]