TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Bogdan Stasjuk.
Numeric keyboard in UIPopoverController for UITextField inspired by ZenKeyboard.
@property(nonatomic, weak) id<BSNumPadPopoverConotrollerDelegate> padDelegate;
@property(nonatomic, assign) BSPopoverPosition padPosition;
- (instancetype)initWithTextField:(UITextField *)textField andTextFieldFormat:(BSTextFieldFormat)textFieldFormat andNextKey:(BOOL)nextKeyExist nextButtonTitle:(NSString *)nextButtonTitle;
- (void)dismissPopoverAnimated:(BOOL)animated onNextKeyPress:(BOOL)nextKeyPressed;
There are following Popover positions and TextField formats:
typedef NS_ENUM(NSUInteger, BSPopoverPosition)
{
BSPopoverPositionLeft,
BSPopoverPositionTop,
BSPopoverPositionRight,
BSPopoverPositionBottom,
};
typedef NS_ENUM(Byte, BSTextFieldFormat)
{
BSTextFieldFormatFloat,
BSTextFieldFormatDate,
BSTextFieldFormatInteger
};
BSNumPadPopoverConotrollerDelegate protocol:
@optional
- (BOOL)isValidTextFieldText:(NSString *)text onNextKeyPress:(BOOL)nextPressed;
- (void)popoverWillAppear;
- (void)popoverDidDisappearOnNextPress:(BOOL)nextPressed;
isValidTextFieldText:onNextKeyPress:
with result TRUE
gives possibility to dismiss numpad view.
self.numPadPopoverConotroller = [[BSNumPadPopoverConotroller alloc] initWithTextField:textField andTextFieldFormat:BSTextFieldFormatFloat andNextKey:YES nextButtonTitle:nil];
self.numPadPopoverConotroller.padDelegate = self;
self.numPadPopoverConotroller.padPosition = BSPopoverPositionBottom;
NumPad appears on textFieldDidBeginEditing:
message.
Clone project and run it. You can find examples of usage at BSTestViewController
.
This class has been tested back to iOS 6.0.
Cocoapods: pod 'BSNumPad'
Manual: Copy the BSNumPad folder in your project
Import header
#import "BSNumPadPopoverConotroller.h"
This code is released under the MIT License. See the LICENSE file for details.