Skip to content

irlabs/IRNumberKeyboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IRNumberKeyboard

A simple numeric keyboard component, with some configurable buttons, build in Swift for iOS.

Different devices and different configurations

( This keyboard was inspired by the MMNumberKeyboard )

Features

  • A special key can be configured with both image or title.
  • The default (dismiss) image and default behavior of the special key can be set.
  • An extra (5th) column of keys can be configured
  • Special key and Extra keys can be disabled
  • Layout of the number keys can be configured: telephone layout or calculator layout
  • Keyboard images can be retrieved through helper enum (a.o. a special plusMinusSign image)
  • Special sample code showing use of arithmetic buttons

Installation

From Carthage

Carthage is a dependency manager for Objective-C and Swift. Add the following line to your Cartfile:

github "irlabs/IRNumberKeyboard"

Then run carthage update.

Follow the current instructions in Carthage's README for up to date installation instructions.

From CocoaPods

Currently IRNumberKeyboard does not support CocoaPods.

If your looking for a numeric keyboard library which you can install through CocoaPods, have a look at MMNumberKeyboard

Usage

In the Xcode project, there is a an example Target NumberKeyboardExample. Build & Run that target and play around.

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.
let keyboard = IRNumberKeyboard()
keyboard.allowsDecimalPoint = true
keyboard.delegate = self

// Configure an example UITextField.
let textField = UITextField()
textField.inputView = keyboard

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

About

Numeric keyboard component for swift / iOS

Resources

License

Stars

Watchers

Forks

Packages

No packages published