ABPadLockScreen is a lightweight, easy-to-use library that provides an elegant and secure PIN-based lock screen for iOS applications. With ABPadLockScreen, you can easily implement a PIN lock screen to protect sensitive data or restrict access to specific features within your app.
- Simple and intuitive PIN lock screen
- Easy to customize – choose from various UI options (colors, fonts, button styles, etc.) to match your app’s design
- Configurable PIN length
- Optionally allow or disallow simple PINs (e.g., 1234, 0000)
- Highly secure – data is encrypted and stored securely in the device’s Keychain
- Option to enable or disable biometric authentication (Touch ID / Face ID)
- Callbacks and delegates for handling events such as successful/unsuccessful PIN entry, creation, and validation
To integrate ABPadLockScreen into your iOS project:
Once you have successfully installed ABPadLockScreen, follow the steps below to get started:
Step 1: Import the library
Import the ABPadLockScreen library into your view controller:
Step 2: Configure the lock screen
Configure the ABPadLockScreen view controller with your desired options. Set a delegate to receive callbacks and customize the appearance as needed:
let lockScreen = ABPadLockScreenViewController(delegate: self)
lockScreen.title = "Enter PIN"
lockScreen.subtitleLabelText = "Please enter your PIN to unlock"
Step 3: Present the lock screen
Once the lock screen is configured, present it modally from your view controller:
present(lockScreen, animated: true)
Step 4: Handle lock screen events
Implement the delegate methods to handle events such as successful/unsuccessful PIN entry, creation, and validation:
func pinEntryWasSuccessful(padLockScreen: ABPadLockScreenViewController!)
func unlockWasCancelledFor(padLockScreen: ABPadLockScreenViewController!)
func unlockWasSuccessfulFor(padLockScreen: ABPadLockScreenViewController!)
For detailed documentation and usage examples, visit the official ABPadLockScreen GitHub repository.
ABPadLockScreen is available under the MIT license. See the LICENSE file for more info.