MMNumberKeyboard
  • March 11, 2024

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


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

From 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 for up to date installation instructions.

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 UITextFieldUITextView 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.

GitHub


View Github

#keyboard #number #text
YOU MIGHT ALSO LIKE...
CameraBackground

Features Both front and back camera supported. Flash modes: auto, on, off. Countdown timer. Tap to focus. Pinch to zoom. Usage  

DKCamera

Description A light weight & simple & easy camera for iOS by Swift. It uses CoreMotion framework to detect device orientation, so ...

HorizonSDK-iOS

Horizon SDK is a state of the art real-time video recording / photo shooting iOS library. Some of the features ...

LLSimpleCamera

LLSimpleCamera: A simple customizable camera - video recorder control LLSimpleCamera is a library for creating a customized camera - video ...

RSBarcodes_Swift

RSBarcodes allows you to read 1D and 2D barcodes using the metadata scanning capabilities introduced with iOS 7 and generate ...