TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Bogdan Stasjuk.
Depends on: | |
BSNumPad | >= 0 |
NSDate+Helpers | >= 0 |
UIDatePicker with UITextField and BSNumPad for entering datetime
@property(weak, nonatomic) id<BSDatePickerPopoverControllerDelegate> datePickerDelegate;
@property(assign, nonatomic) BSPopoverPosition popoverPosition;
- (id)initWithTextField:(UITextField *)textField;
There are following Popover positions:
typedef NS_ENUM(NSUInteger, BSPopoverPosition) {
BSPopoverPositionLeft,
BSPopoverPositionTop,
BSPopoverPositionRight,
BSPopoverPositionBottom,
};
BSDatePickerPopoverControllerDelegate protocol:
@optional
- (BOOL)isValidPopoverDate:(NSString *)date;
- (void)datePickerPopoverDidDisappear;
isValidPopoverDate:
with result TRUE
gives possibility to dismiss datePickerPopover view.
pod 'BSNumPad'
pod 'NSDate+Helpers'
self.popover = [[BSDatePickerPopoverController alloc] initWithTextField:self.textField];
self.popover.popoverPosition = BSPopoverPositionTop;
self.popover.datePickerDelegate = self;
DatePickerPopover appears on textFieldDidBeginEditing:
message.
Clone project and run it. You can find examples of usage at TestViewController
.
This class has been tested back to iOS 6.0.
Cocoapods: pod 'BSDatePickerWithPad'
Manual: Copy the BSDatePickerWithPad folder in your project
Import header
#import "BSDatePickerPopoverController.h"
This code is released under the MIT License. See the LICENSE file for details.