Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/matmartinez/MMNumberKeyboard
A simple keyboard to use with numbers and, optionally, a decimal point.
https://github.com/matmartinez/MMNumberKeyboard
Last synced: 3 months ago
JSON representation
A simple keyboard to use with numbers and, optionally, a decimal point.
- Host: GitHub
- URL: https://github.com/matmartinez/MMNumberKeyboard
- Owner: matmartinez
- License: mit
- Created: 2015-12-10T22:15:43.000Z (almost 9 years ago)
- Default Branch: main
- Last Pushed: 2023-07-04T11:43:55.000Z (over 1 year ago)
- Last Synced: 2024-07-19T16:09:20.697Z (4 months ago)
- Language: Objective-C
- Size: 1.92 MB
- Stars: 958
- Watchers: 23
- Forks: 112
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - MMNumberKeyboard - A simple keyboard to use with numbers and, optionally, a decimal point. (UI / Keyboard)
- awesome-ios-star - MMNumberKeyboard - A simple keyboard to use with numbers and, optionally, a decimal point. (UI / Keyboard)
README
# MMNumberKeyboard
A simple keyboard to use with numbers and, optionally, a decimal point.![And it works great on the iPad too](UniversalScreenshot.png)
## Installation
### From CocoaPods
[CocoaPods](http://cocoapods.org) 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](http://guides.cocoapods.org/using/using-cocoapods.html):```ruby
pod 'MMNumberKeyboard'
```Second, install `MMNumberKeyboard` into your project:
```ruby
pod install
```### From Carthage
[Carthage](https://github.com/Carthage/Carthage) is a dependency manager for Objective-C and Swift. Add the following line to your `Cartfile`:```
github "matmartinez/MMNumberKeyboard"
```The run `carthage update`.
Follow the current instructions in [Carthage's README][carthage-installation]
for up to date installation instructions.[carthage-installation]: https://github.com/Carthage/Carthage#adding-frameworks-to-an-application
## 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.
```objective-c
// 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](https://github.com/pedroburon/) for the encouragement and moral support to make this `README` file possible.