All Projects → Alterplay → APPinViewController

Alterplay / APPinViewController

Licence: MIT License
Drop-in iOS component for PIN (4 digit passcode) logic by folks from

Programming Languages

objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].