MMNumberKeyboard 0.3.3

MMNumberKeyboard 0.3.3

测试已测试
Lang语言 Obj-CObjective C
许可 MIT
发布最后发布2020年10月

Matías Martínez 维护。



  • Matías Martínez

MMNumberKeyboard

一个简单的键盘,可用于数字,可选地包括小数点。

And it works great on the iPad too

安装

来自CocoaPods

CocoaPods 是一个Objective-C的依赖管理器,它自动化并简化了将第三方库如MMNumberKeyboard用于项目中。首先,将以下行添加到您的 Podfile

pod 'MMNumberKeyboard'

其次,将MMNumberKeyboard安装到您的项目中

pod install

来自Carthage

Carthage 是一个Objective-C和Swift的依赖管理器。将以下行添加到您的 Cartfile

github "matmartinez/MMNumberKeyboard"

运行carthage update

请遵循Carthage的README文件中的最新安装说明。

用法

这里有一个可供使用的Xcode项目示例。只需构建并运行即可。

基本上,您可以实例化自己的键盘视图,将其用作UITextFieldUITextView或任何支持文本编辑的视图的.inputView

// Create and configure the keyboard.
MMNumberKeyboard *keyboard = [[MMNumberKeyboard alloc] initWithFrame:CGRectZero];
keyboard.allowsDecimalPoint = YES;
keyboard.delegate = self;

// Configure an example UITextField.
UITextField *textField = [[UITextField alloc] initWithFrame:CGRectZero];
textField.inputView = keyboard;

您可以采用MMNumberKeyboardDelegate协议来处理回车键或者是否插入文本。

开发

欢迎提交pull request。

鸣谢

感谢Pedro Burón对该README文件的支持和鼓励。