Skip to content
🔑 Passcode View to lock iOS apps
Swift Objective-C
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Passcode.xcodeproj Lowers required iOS Version Jun 3, 2018
Passcode Fixes autoBiometrics Jun 4, 2018
PasscodeExample/Example Lowers required iOS Version Jun 3, 2018
.gitignore Initial commit Feb 2, 2018
.swiftlint.yml Initial commit Feb 2, 2018
.travis.yml
LICENSE Initial commit Feb 2, 2018
README.md Update README.md Feb 5, 2018

README.md

Passcode Platforms Carthage Swift License

Usage

let window = ... // Window to display this on e.g. AppDelegate Window

// Config
let config = PasscodeConfig(passcodeGetter: {
            // Return code as string
        }, passcodeSetter: { code in
            // Save new code
        }, biometricsGetter: {
            // return Should use biometrics (Touch ID or Face ID) as Bool
        })

// window can be nil if you only use it on UIViewControllers
let passcode = Passcode(window: self.window, config: config)

Asks for Authentication over current window

passcode.authenticateWindow()

Asks for authentication on ViewController

passcode.authenticate(on: viewController, animated: true)

Asks for code on ViewController

passcode.askCode(on: viewController, animated: true)

Asks changes code on ViewController

passcode.changeCode(on: viewController, animated: true)

All functions have completions if authentication or code change was successful e.g.

passcode.askCode(on: viewController, animated: true) { success in
	print("Code was entered correctly? \(success)"
}

For an example implementation see the Example app.

The default passcode is 1234

Installation

Passcode is available through Carthage. To install just write into your Cartfile:

github "divadretlaw/Passcode"

License

See LICENSE

Copyright © 2018 David Walter (www.davidwalter.at)

You can’t perform that action at this time.