测试已测试 | ✗ |
语言语言 | Obj-Cobjective-c |
许可证 | BSD 许可证 |
发布最新发布 | 2015年3月 |
由 Bas van Kuijck 维护。
依赖关系 | |
Masonry | ~> 0.6 |
ReactiveCocoa | ~> 2.4 |
FXBlurView | ~> 1.6 |
iOS7 风格的密码锁。完全可定制。
pod 'ESPinEntryView', '~> 1.0'
以下类有以下依赖关系
QuartzCore
框架AudioToolbox
框架#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];
#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];
- (BOOL)pinEntry:(ESPinEntryView *)pinEntryView isValidCode:(NSString *)code
{
NSLog(@"Attempt %zd", pinEntryView.attempts);
return [code isEqualToString:@"1234"];
}
deleteText
:删除按钮中的文本(默认值为 "删除")cancelText
:取消按钮中的文本(默认值为 "取消")headerText
:提示用户输入密码的顶部文本(默认值为 "输入密码")showCancelButton
:当没有输入数字时是否应该显示取消按钮(默认值为 NO)showAlphabet
:输入按钮是否应包含字母字符。(默认值 = NO)backgroundView
:输入按钮是否应包含字母字符。(默认值为蓝灰色背景)backgroundBlurRadius
:应用于背景视图的模糊半径(默认值为 15)backgroundColor
:覆盖在 backgroundView 上的背景颜色(默认值为 70% 不透明度的黑色)numberOfDigits
:应输入的总数字数。(默认值为 4)attempts
:总的尝试次数(只读)code
:输入的密码(只读)vibrate
:当提供错误输入时设备是否振动(默认值 = YES)委托