转载

[iOS] 一个原生风格的密码视图控制器

CVPasscodeController

A native looks passcode input interface.

Introduction

CVPasscodeController provide you with a easy way to achieve local authentication, which only requires you make little change in your project.

Screenshot

[iOS] 一个原生风格的密码视图控制器 [iOS] 一个原生风格的密码视图控制器

Features

  • Two interface style (dark / light).
  • Supports arbitrary digits.
  • Customizable interface strings.

Example

To run the example project, clone the repo, and build the example scheme.

Installation

CVPasscodeController is available through Carthage. To install it, simply add the following line to your Cartfile:

github "unixzii/CVPasscodeController"

Usage Guide

CVPasscodeController is the main class you will work on. Instantiate a CVPasscodeController object, pass a preferred style to its initializer.

CVPasscodeEvaluating is another important protocol you need to implement, it allow the controller evaluate the passcode. One thing need to be concerned is your evaluating process should not block the main thread, it should return quickly. Before returning the result, you can schedule something that will happen after user input a correct passcode. For more, see the example project.

Any strings appear on the interface can be customized, only thing you need to do is implement CVPasscodeInterfaceStringProviding protocol.

After all thing is done, just present it as a view controller.

License

The project is available under the MIT license. See the LICENSE file for more info.

原文  https://github.com/unixzii/CVPasscodeController
正文到此结束
Loading...