Latest | 0.0.4 |
---|---|
Homepage | https://github.com/AlexeyYuPopkov/PANumberKeyboard |
License | MIT |
Platforms | ios 8.0 |
Frameworks | Foundation |
Authors |
Customizible Number Keyboard with optional decimal point
Install:
use_frameworks!
platform :ios, '8.0'
pod 'PANumberKeyboard'
Usage:
Swift:
import PANumberKeyboard
……
let keyboardVC = PANumberKeyboardViewController.createDecimalKeyboard()
keyboardVC.allowDecimalPoint = true
keyboardVC.numberKeyboardReturnButton.setTitle("Next", forState: .Normal)
self.textField.inputView = self.keyboardVC.numberKeyboardView
Objective-C:
#import <PANumberKeyboard/PANumberKeyboard-Swift.h>
……
PANumberKeyboardViewController *keyboard = [PANumberKeyboardViewController createDecimalKeyboard];
[keyboard setAllowDecimalPoint:YES];
[[keyboard numberKeyboardReturnButton] setTitle:@“Next” forState:UIControlStateNormal];
[[self textField] setInputView:[keyboard numberKeyboardView]];
Customization:
Buttons Callbacks
public var backspaceAction:((Void) -> Void)?
public var newTextAction:((text:String) -> Void)?
public var returnAction:((Void) -> Void)?
Button Background Color/Image for Selected State
public func setSelectedTextButtonBackgroundImage(image:UIImage)
public func setSelectedBackspaceButtonBackgroundImage(image:UIImage)
public func setSelectedReturnButtonBackgroundImage(image:UIImage)
public func setSelectedTextButtonBackgroundColor(color:UIColor)
public func setSelectedBackspaceButtonBackgroundColor(color:UIColor)
public func setSelectedReturnButtonBackgroundColor(color:UIColor)
Allow Decimal Point
public var allowDecimalPoint:Bool
Present Decimal Point as “.” or “,”
public var decimalPointAsComma:Bool
Getters for button customization
public var numberKeyboardBackspaceButton:UIButton // Backspace Button
public var numberKeyboardReturnButton:UIButton // Return Button
public var textButtons:[UIButton] // “0”-“9” and “.” Button Array
public var allButtons:[UIButton] // Array of all buttons
Latest podspec
{ "name": "PANumberKeyboard", "version": "0.0.4", "summary": "PANumberKeyboard is a UIViewController with custom decimal keyboard", "homepage": "https://github.com/AlexeyYuPopkov/PANumberKeyboard", "license": { "type": "MIT", "file": "LICENSE" }, "authors": { "Alexey Popkov": "[email protected]" }, "platforms": { "ios": "8.0" }, "source": { "git": "https://github.com/AlexeyYuPopkov/PANumberKeyboard.git", "tag": "0.0.4" }, "source_files": "Classes/*.{swift}", "resources": "Resources/*.{png,xib}", "frameworks": "Foundation" }
Sun, 06 Mar 2016 07:43:03 +0000