Skip to content

Golden-Flag/ESPinEntryView

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPinEntryView

Platform Version

iOS7 style passcode lock. Fully customizable.

Examples

Installation

Cocoapods

pod 'ESPinEntryView', '~> 1.0'

Manually

These classes have the following dependecies:

Usage

ESPinEntryView

#import <ESPinEntryView.h>

ESPinEntryView *entryView = [[ESPinEntryView alloc] initWithFrame:self.view.bounds];
[entryView setBackgroundBlurRadius:15];
[entryView setDelegate:self];
[entryView setBackgroundView:[[UIView alloc] init]];
[entryView.backgroundView setBackgroundColor:[UIColor blueColor]];
[entryView setShowAlphabet:YES];
[entryView setShowCancelButton:YES];
[self.view addSubview:entryView];

ESPinEntryViewController

#import <ESPinEntryViewController.h>

ESPinEntryViewController *viewController = [[ESPinEntryViewController alloc] init];
[viewController setDelegate:self];
[viewController.pinEntryView setBackgroundBlurRadius:15];
[viewController.pinEntryView setBackgroundView:[[UIView alloc] init]];
[viewController.pinEntryView setBackgroundColor:[UIColor blueColor]];
[viewController.pinEntryView setShowAlphabet:YES];
[viewController.pinEntryView setShowCancelButton:YES];
[self presentViewController:viewController animated:YES completion:nil];

Delegates

- (BOOL)pinEntry:(ESPinEntryView *)pinEntryView isValidCode:(NSString *)code
{
    NSLog(@"Attempt %zd", pinEntryView.attempts);
    return [code isEqualToString:@"1234"];
}

Customize

Localization

  • deleteText: The text in the delete button (default = "Delete")
  • cancelText: The text in the cancel button (default = "Cancel")
  • headerText: The top text that asks the user to enter a passcode (default = "Enter Passcode")

Appearance

  • showCancelButton: Should the cancel button appear when no digits are entered (Default = NO)
  • showAlphabet: Should the entry buttons contain alphabet characters. (Default = NO)
  • backgroundView: Should the entry buttons contain alphabet characters. (Default = Blue/grayish background)
  • backgroundBlurRadius: The blur radius given to the background view (Default = 15)
  • backgroundColor: The background color that overlays the backgroundView (Default = 70% alpha black)

Validation

  • numberOfDigits: The total number of digits that should be entered. (Default = 4)
  • attempts: The total number of attempts (readonly)
  • code: The code that is entered. (readonly)
  • vibrate: Should the device vibrate when an incorrect entry is given (Default = YES)

General

  • delegate

About

iOS7 style passcode lock. Fully customizable.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 97.8%
  • Ruby 2.2%