BSDatePickerWithPad 1.0.2

BSDatePickerWithPad 1.0.2

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

BSDatePickerPopoverController public properties and methods

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

Project uses next pods:

pod 'BSNumPad'
pod 'NSDate+Helpers'

Initialization

    self.popover = [[BSDatePickerPopoverController alloc] initWithTextField:self.textField];
    self.popover.popoverPosition = BSPopoverPositionTop;
    self.popover.datePickerDelegate = self;

DatePickerPopover appears on textFieldDidBeginEditing: message.

Numeric keyboard view:

Demo

Clone project and run it. You can find examples of usage at TestViewController.

Compatibility

This class has been tested back to iOS 6.0.

Installation

Cocoapods: pod 'BSDatePickerWithPad'
Manual: Copy the BSDatePickerWithPad folder in your project

Import header

#import "BSDatePickerPopoverController.h"

License

This code is released under the MIT License. See the LICENSE file for details.