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

PGNumberKeyboard是一款简洁美观的自定义数字键盘,支持输入负数及内置数字验证算法,免去了开发者自行判断小数或负数合法性的麻烦。适用于UITextField及UITextView。

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

github.com/xiaozhuxiong121/PGNumberKeyboard

转载于:https://juejin.im/post/5a312b0df265da43070344ca

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值