Latest 0.1.3
Homepage https://github.com/ekusuy-osas/MocaLock
License MIT
Platforms ios 11.0
Authors

This is a library for displaying password lock screen. It also supports biometrics (Face ID, TouchID).

  • Prompt for entering and re-entering password with RegisterType.

  • Prompt for password input or biometric authentication with UnlockType.
    You can customize the design if you wish.

Installation

  • CocoaPods

    “`:Podfile
    pod ‘MocaLock’

Usage

Just create an instance of MocaLockViewController and perform screen transition to display the password lock screen.

Specify MocaLockType.register to display the password registration screen.

“`Swift:ViewController.swift
let vc = MocaLockViewController.init(mocaLockType: .register)
vc.registerDelegate = self
self.present(vc, animated: true, completion: nil)


Receive events on MocaLockUnlockDelegate.

Specify MocaLockType.unlock to display the password entry screen.

```Swift:ViewController.swift
let vc = MocaLockViewController.init(mocaLockType: .unlock)
vc.unlockDelegate = self
vc.unlockPassword = "1234"
self.present(vc, animated: true, completion: nil)

Receive events on MocaLockUnlockDelegate.

To change the wording in MocaLockViewController, add MocaLockLocalized.strings to the project and describe the following items.

“`strings:MocaLockLocalized.strings
// word
"delete" = "Delete";
"back" = "Back";
"faceId" = "Face ID";
"touchId" = "Touch ID";

// message
"enterRegisterPasswordMsg" = "Please enter a password to register.";
"enterUnlockPasswordMsg" = "Please enter your password.";
"enterPasswordAgainMsg" = "Please enter password again.";
"passwordNotMatchMsg" = "Passwords do not match.";
"passwordIncorrectMsg" = "Password is incorrect.";
"authFailedMsg" = "Authentication failed.";
"bioAuthDisabledMsg" = "Bio auth is disabled.";

"passwordLockReason" = "App unlock.";



If you want more customization, add MocaLockView to your ViewController and set MocaLockViewDataSource and MocaLockViewDelegate to MocaLockView.

MocaLockViewDataSource is responsible for generating UI components.
MocaLockViewDelegate is responsible for action callback on MocaLockView

Latest podspec

{
    "name": "MocaLock",
    "version": "0.1.3",
    "swift_versions": "5.0",
    "platforms": {
        "ios": "11.0"
    },
    "summary": "It is a library for displaying the password lock screen in the iOS application.",
    "homepage": "https://github.com/ekusuy-osas/MocaLock",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "yusuke.sasou": "[email protected]"
    },
    "source": {
        "git": "https://github.com/ekusuy-osas/MocaLock.git",
        "tag": "0.1.3"
    },
    "source_files": "MocaLock/**/*.{swift}",
    "exclude_files": "MocaLock/**/*.{xib,png}",
    "swift_version": "5.0"
}

Pin It on Pinterest

Share This