- 支持4位或6位的安全码/验证码。
- 设置设置边框颜色,数字字体及颜色。
- 支持 xib, storyboard。
- 支持用下划线替代边框模式。
方法一:QuickSecurityCode
is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod 'QuickSecurityCode'
#import <QuickSecurityCode/QuickSecurityCode.h>
@interface ViewController ()
@property (weak, nonatomic) IBOutlet QuickSecurityCode *securityCodeCtrl1;
@property (weak, nonatomic) IBOutlet QuickSecurityCode *securityCodeCtrl2;
@property (weak, nonatomic) IBOutlet QuickSecurityCode *securityCodeCtrl3;
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.securityCodeCtrl1.digitFont = [UIFont boldSystemFontOfSize:18.0f];
self.securityCodeCtrl1.complete = ^(NSString *code) {
NSLog(@"SecurityCodeCtrl1: %@", code);
};
self.securityCodeCtrl2.complete = ^(NSString *code) {
NSLog(@"SecurityCodeCtrl2: %@", code);
};
self.securityCodeCtrl3.digitFont = [UIFont boldSystemFontOfSize:18.0f];
self.securityCodeCtrl3.complete = ^(NSString *code) {
NSLog(@"SecurityCodeCtrl3: %@", code);
};
}
@end