Drop-in iOS component for PIN (4 digit passcode) logic by folks from
Objective-C Ruby
Switch branches/tags
Nothing to show
Latest commit ee8c000 Aug 14, 2014 @Krivoblotsky Krivoblotsky Merge pull request #3 from Nykho/master
Update APPinViewController.m
Permalink
Failed to load latest commit information.
APPinCodeExpample
APPinExpample.xcodeproj
APPinVIewController
.gitignore
APPinViewController.podspec
LICENSE
README.md

README.md

Easy drop-in component for iOS developers to deal easy with PIN (4 digit passcode) logic. This is the first version but we truly tried to make it reusable and customizable enough to save development time.

###How to Use:

  1. Subclass APPinViewController:

    @interface SamplePinViewController : APPinViewController

  2. Bind your APPinView with File Owner's 'pinCodeView' in Xib on StoryBoard. (How to do it?)

..and this is it.

####To Set PIN: SamplePinViewController *pinVC = [SamplePinViewController new]; [self.navigationController pushViewController:pinVC animated:YES];

Delegate:

- (void)pinCodeViewController:(APPinViewController *)controller didCreatePinCode:(NSString *)pinCode {
    //Handle your pin code here
    //
    [self.navigationController popViewControllerAnimated:YES];
}

####To Verify PIN:

SamplePinViewController *pinVC = [SamplePinViewController new];
pinVC.pinCodeToCheck = <#Your Pin To Verify#>;
[self.navigationController pushViewController:pinVC animated:YES];

Delegate:

- (void)pinCodeViewController:(APPinViewController *)controller didVerifiedPincodeSuccessfully:(NSString *)pinCode {
    //Pin code verified
    [self.navigationController popViewControllerAnimated:YES];
}

####To Change PIN:

SamplePinViewController *pinVC = [SamplePinViewController new];
pinVC.pinCodeToCheck = <#Your Pin To Change#>;
pinVC.shouldResetPinCode = YES;
[self.navigationController pushViewController:pinVC animated:YES];

Delegate:

- (void)pinCodeViewController:(APPinViewController *)controller didChangePinCode:(NSString *)pinCode {
    //Handle your new pin code here
    
    [self.navigationController popViewControllerAnimated:YES];
}

To Handle Unsuccessful Attempts:

- (void)pinCodeViewController:(APPinViewController *)controller didFailVerificationWithCount:(NSUInteger)failsCount;

####...and One More Thing: You can feel free to customize pin view by changing its frame and position and set image for pins:

self.pinCodeView.selectedPinImage = <#Your UIImage#>
self.pinCodeView.normalPinImage = <#Your UIImage#>

####Example screenshots:

githalytics.com alpha If you have improvements or concerns, feel free to post an issue and write details.

======================= Check out all Alterplay's GitHub projects. Email us with other ideas and projects.