Code Monkey home page Code Monkey logo

pinpad's Introduction

PinPad

View like iOS7 Lock screen

Dynamic count of input numbers and custom configuration. Works on iOS 5+.

How to use

  • Add the folder PinPad in your project folder

  • Add #import "PPPinPadViewController.h" in your viewController(in the .h file)

  • Implement the protocol PinPadPasswordProtocol in your class

  • This protocol has simple methods to control the pin pad

      - (BOOL)checkPin:(NSString *)pin; 	//required, validation with your configured code
      - (NSInteger)pinLength; 			//required, works like a data source of pin length
      - (void)pinPadSuccessPin;			//optional, when the user set a correct pin
      - (void)pinPadWillHide;				//optional, before the pin pad hide
      - (void)pinPadDidHide;				//optional, after pin pad hide
      - (void)userPassCode:(NSString *)newPassCode; //optional, set new user passcode
    
  • In your code, setup the controller as shown below:

      PPPinPadViewController * pinViewController = [[PPPinPadViewController alloc] init];
      pinViewController.delegate = self;
      pinViewController.pinTitle = @"Enter Passcode";	    pinViewController.isSettingPinCode = YES; // YES-input new passcode and confirmation 
      pinViewController.errorTitle = @"Passcode is not correct";
      pinViewController.cancelButtonHidden = NO; //default is False
      pinViewController.backgroundImage = [UIImage imageNamed:@"pinViewImage"]; //if you need remove the background set a empty UIImage ([UIImage new]) or set a background color
      pinViewController.backgroundColor = [UIColor darkGrayColor]; //default is a darkGrayColor
      
      [self presentViewController:pinViewController animated:YES completion:NULL];
    

Credits

License

PinPad is provided under the MIT license.

pinpad's People

Contributors

busta117 avatar ihomam avatar kosyloa avatar

Watchers

 avatar  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.