To run the example project, clone the repo, and run pod install
from the Example directory first.
#import <WSDatePicker/WSDatePicer.h>
/// instance
WSDatePickerController *b = [WSDatePickerController new];
/// set type as you like
b.pickerType = WSDatePickerTypeYEARANDMONTHANDDAY;
/// set default date
NSDateFormatter *format = [NSDateFormatter new];
[format setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *dt = [format dateFromString:@"2016-12-12 12:12:12"];
b.defaultDate = dt;
///callback block
[b setCallback:^(NSInteger year, NSInteger month, NSInteger day, NSInteger hour, NSInteger minute, NSInteger second) {
NSLog(@"%d %d %d %d %d %d",year,month,day,hour,minute,second);
}];
/// ok,last, present
[self presentViewController:b animated:YES completion:nil customerAnimated:YES];
WSDatePicker is available through CocoaPods. To install it, simply add the following line to your Podfile:
pod "WSDatePicker"
王的世界, [email protected]
WSDatePicker is available under the MIT license. See the LICENSE file for more info.