A date picker view to choose date and time in Objective-C. it supports iOS 8.0 later and it can run in any devices,such as iPhone 4~iPhone X
增加头文件
#import "FAZTimePicker.h"
代码实现
FAZTimerPicker *datePicker = [[FAZTimerPicker alloc]init];
datePicker.minLimitDate = [NSDate dateWithTimeIntervalSinceNow:7200];
datePicker.maxLimitDate = [NSDate dateWithTimeIntervalSinceNow:14400];
datePicker.dateOutputFomatterString = @"yyyy-MM-dd HH:mm";
datePicker.commitBlock = ^(NSDate *date,NSString *dateString)
{
self.label.text = dateString;
};
[datePicker show];