GithubHelp home page GithubHelp logo

pinview's Introduction

Passcode view

About

This project gives you a passcode control that can be dropped into any iOS app. It behaves exactly like the passcode screens that can be seen by going to Settings > General > Passcode Lock.

Features

  • Native iOS look and feel
  • Masks pin entry with bullet characters
  • Provide your own theme by using a custom nib file
  • Provide custom text to be displayed on the passcode entry view
  • Block-based passcode verification

Installation

  • Drag the "pinview" folder to your Xcode project (make sure "copy files", "create groups", and the appropriate target are selected)
  • Add the AudioToolbox framework to your target

Examples

Here are some quick examples. To see them in use, open the "SampleApp" Xcode project.

Create a new passcode

GCPINViewController *PIN = [[GCPINViewController alloc]
                            initWithNibName:nil
                            bundle:nil
                            mode:GCPINViewControllerModeCreate];
PIN.messageText = @"Create Passcode";
PIN.errorText = @"The passcodes do not match";
PIN.verifyBlock = ^(NSString *code) {
    NSLog(@"setting code: %@", code);
    return YES;
};
[PIN presentFromViewController:self animated:YES];
[PIN release];

Verify a passcode

GCPINViewController *PIN = [[GCPINViewController alloc]
                            initWithNibName:nil
                            bundle:nil
                            mode:GCPINViewControllerModeVerify];
PIN.messageText = @"Check Passcode";
PIN.errorText = @"Incorrect passcode";
PIN.verifyBlock = ^(NSString *code) {
    NSLog(@"checking code: %@", code);
    return [code isEqualToString:@"0187"];
};
[PIN presentFromViewController:self animated:YES];
[PIN release];

pinview's People

Contributors

calebd avatar srwebster avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.