PGNumberKeyboard
一款非常簡單漂亮靈活的自定義數(shù)字鍵盤,可以輸入負數(shù)闲礼,內(nèi)置了數(shù)字驗證算法。你不需要在判斷輸入的小數(shù)或者負數(shù)是否合法
Installation with CocoaPods
pod 'PGNumberKeyboard', '~> 1.0.3'
Usage
UITextField
#import <PGNumberKeyboard/PGNumberKeyboard.h>
self.yourTextField.inputView = [[PGNumberKeyboard alloc]initWithTextField:self.yourTextField];
UITextView
self.yourTextView.inputView = [[PGNumberKeyboard alloc]initWithTextView:self.yourTextView];
Advanced Usage
UITextField
PGNumberKeyboard *keyboard = [[PGNumberKeyboard alloc]initWithTextField:self.yourTextField];
keyboard.delegate = self;
self.yourTextField.inputView = keyboard;
#pragma mark - PGNumberKeyboardManagerDelegate
- (void)editChanage:(id)sender {
}
UITextView
PGNumberKeyboard *keyboard = [[PGNumberKeyboard alloc] initWithTextView:self.yourTextView];
keyboard.delegate = self;
self.yourTextView.inputView = keyboard;
#pragma mark - PGNumberKeyboardManagerDelegate
- (void)editChanage:(id)sender {
}