A simple custom iOS date picker.
Simply slide up from the bottom
Whenever user select on year/month/day , will info delegate with all new value.
@protocol ZHDatePickerDelegate <NSObject>
@optional
- (void)didSelectDateWithDate:(NSDate *)date year:(NSInteger)year month:(NSInteger)month day:(NSInteger)day;
@end
@property(nonatomic, assign) NSInteger minYear;//default : 1960
@property(nonatomic, assign) NSInteger maxYear;//default : 100 + today's year
typedef enum {
ZHDatePickerDisplayModeFreeStyle = 0,
ZHDatePickerDisplayModelBeforeCurrent = 1
} ZHDatePickerDisplayMode;
- ZHDatePickerDisplayModeFreeStyle
Select date whatever you want from default setting (1960 - 100 years after current year)
- ZHDatePickerDisplayModelBeforeCurrent
Set the maximun Date to today's date , and limit user's selection from 1960 - current year
- Slide position
- Time selection
- Background and Text Color
To run the example project, clone the repo, and run pod install
from the Example directory first.
ZHDatePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "ZHDatePicker"
zhhlmr, zhouhan199132@gmail.com
ZHDatePicker is available under the MIT license. See the LICENSE file for more info.