本文为CocoaChina网友piggybear投稿
一款非常简单漂亮灵活的自定义数字键盘,可以输入负数,内置了数字验证算法。你不需要在判断输入的小数是否合法
CocoaPods安装
pod 'PGNumberKeyboard'
使用
#import [PGNumberKeyboardManager new].textField = yourTextField;
如果你想得到textField.text的内容,可以设置代理
#import PGNumberKeyboardManager *manager = [[PGNumberKeyboardManager alloc]init]; manager.delegate = self; manager.textField = yourTextField; #pragma mark - PGNumberKeyboardManagerDelegate - (void)editChanage:(UITextField *)textField { NSLog(@"text = %@/ttag = %ld", textField.text, textField.tag); }
地址