美文网首页征服iOS
一行代码集成带负数的自定义键盘

一行代码集成带负数的自定义键盘

作者: piggybear | 来源:发表于2017-06-30 18:01 被阅读234次

PGNumberKeyboard

一款非常简单漂亮灵活的自定义数字键盘,可以输入负数,内置了数字验证算法。你不需要在判断输入的小数或者负数是否合法

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 {
}

GirHub Address

https://github.com/xiaozhuxiong121/PGNumberKeyboard

相关文章

网友评论

    本文标题:一行代码集成带负数的自定义键盘

    本文链接:https://www.haomeiwen.com/subject/qjsicxtx.html