Skip to content

A simple keyboard to use with numbers and, optionally, a decimal point.

License

Notifications You must be signed in to change notification settings

vincentlong889/MMNumberKeyboard

 
 

Repository files navigation

MMNumberKeyboard

A simple keyboard to use with numbers and, optionally, a decimal point.

Screenshot

Installation

From Cocoapods

CocoaPods is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like MMNumberKeyboard in your projects. First, add the following line to your Podfile:

pod 'MMNumberKeyboard'

Second, install MMNumberKeyboard into your project:

pod install

Usage

There is a sample Xcode project available. Just build & run. And profit.

Basically you instantiate your own keyboard view to use as an .inputView of your UITextField, UITextView or whatever view that supports text editing.

// 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;

You can adopt the MMNumberKeyboardDelegate protocol to handle the return key or whether text should be inserted or not.

Development

Pull requests are welcome and mostly appreciated.

Credits

Thanks to Pedro Burón for the encouragement and moral support to make this README file possible.

About

A simple keyboard to use with numbers and, optionally, a decimal point.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 98.1%
  • Ruby 1.9%