Git Product home page Git Product logo

pinview's Introduction

ABOUT:

This project gives you a drop-in PIN code entry screen that looks like the entry screen seen in Settings.app.

Features:

  • native iOS look and feel
  • mask pin entry with bullet characters or optionally show the actual input
  • provide your own theme by providing a custom NIB file
  • provide custom text to be displayed on the PIN entry view
  • delegate methods allow you to verify the user-provided PIN code

ADD TO YOUR PROJECT:

  • open the PINView Xcode project
  • drag the pinview group into your project (make sure copy files is selected)

USE THIS CODE:

  • create the pin view object using the initWithNibName:bundle: of UIViewController
  • set the delegate on the view controller (YOU MUST DO THIS)
  • implement the isPINCodeValid: delegate method to allow validation of the provided code
  • set options like the view title or error text
  • display from a view controller using the presentViewFromViewController:animated: convenience method

EXAMPLE:

Delegate Method

- (BOOL)pinView:(GCPINViewController *)pinView validateCode:(NSString *)code {
	BOOL correct = [code isEqualToString:@"1234"];
	if (correct) {
		[pinView dismissModalViewControllerAnimated:YES];
	}
	return correct;
}

Create View

GCPINViewController *pinView = [[GCPINViewController alloc] initWithNibName:@"PINViewDefault" bundle:nil];
[pinView setDelegate:self];
[pinView setMessageText:@"Enter Your PIN"];
[pinView setTitle:@"PIN Code"];
[pinView setErrorText:@"Awww You Suck"];

THEMES:

I haven't tested this, but you should be able to create a custom NIB file containing the appropriate elements changing the background or keyboard style (dark vs. default)

Just change the NIB name you pass in the initWithNibName:bundle call

pinview's People

Contributors

calebd avatar

Stargazers

Saurabh Garg avatar

Watchers

 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.