irpas技术客

iOS年月日、时分秒选择器_wuwuFQ_ios 时间选择器

网络投稿 1846

FQDateTimeSDK

GitHub地址

iOS年月日、时分秒选择器。 在原生控件的基础上增加秒的选择,和原生PickerView一样的丝滑。

更新记录 版本更新内容日期1.1.2- 修复picker显示问题 - 优化选择器的选择动画2022-11-291.1.1- 优化时分秒的显示2022-11-231.1- 设置maxDate、minDate后,范围外的时间不可见2022-10-011.0.6- picker可以展示在view和window上2022-09-231.0.5- 优化picker弧度,更贴合原生2022-09-141.0.4- 增加pickerBackgroundColor,可以修改pickerView背景色 - 支持bitcode2022-08-081.0.3- 增加maskBackgroundColor,可以修改遮罩背景色2022-05-271.0.2- 增加target,用以区分pickerView2022-05-141.0.1- 日期的单位支持自定义 - 修复每月天数不实时刷新2022-04-291.0- 增加更多picker模式:支持年月、年月日、时分、时分秒、年月日时分、年月日时分秒 - 可自定义字体大小和颜色2022-04-21
功能介绍 支持年月日模式支持时分秒模式支持年月日时分秒模式支持默认时间和最大、最小时间支持标题的设置,默认为空字体大小和颜色可以自定义支持背景色和遮罩颜色自定义SDK支持bitcode 集成方式 手动集成 把项目clone或Download ZIP到本地把项目内的FQDateTimeSDK.framework拖到你的项目里 如果项目报错 Library not loaded: @rpath/FQDateTimeSDK.framework/FQDateTimeSDK, 设置 Embed&Sign 如果项目报错Building for iOS Simulator, but the linked and embedded framework 'FQDateTimeSDK.framework' was built for iOS + iOS Simulator. 解决方法是: Buil Settings --> Build Options --> Validate Workspace 改为Yes cocoaPods自动集成

这里默认大家对cocoaPods都是信手拈来的

在Podfile引入 pod 'FQDateTimeSDK'

或者

pod 'FQDateTimeSDK', '~> 1.1.2' 在终端 cd 到你的项目根路径 下载 pod install

或者

pod install --no-repo-update 更新 pod update

或者

pod update FQDateTimeSDK --no-repo-update 使用案列 在用到时间选择器的地方引用头文件 #import <FQDateTimeSDK/FQDateTimeSDK.h> 遵循代理FQDateTimePickerViewDelegate @interface ViewController ()<FQDateTimePickerViewDelegate> @end 实现代理方法 - (void)confirmActionWithDate:(nonnull NSDate *)date withDateString:(nonnull NSString *)dateStr withTarget:(NSInteger)target { NSLog(@"wuwuFQ:%@---%@", date, dateStr); } - (void)cancelActionWithTarget:(NSInteger)target { NSLog(@"wuwuFQ:cancelAction"); } - (void)scrollActionWithDate:(nonnull NSDate *)date withDateString:(nonnull NSString *)dateStr withTarget:(NSInteger)target { NSLog(@"wuwuFQ:%@---%@", date, dateStr); } 年月日选择器 FQDateTimePickerView *pickerView = [[FQDateTimePickerView alloc] init]; pickerView.delegate = self; //遵循代理 pickerView.pickerModel = FQDateTimePickerModelDate; //日期模式 pickerView.cancelColor = [UIColor greenColor]; //取消颜色 pickerView.pickerColor = [UIColor yellowColor]; //滚轮字体颜色 pickerView.maskBackgroundColor = UIColor.cyanColor; //遮罩颜色 pickerView.pickerBackgroundColor = UIColor.lightGrayColor; //选择器背景色 pickerView.title = @"wuwuFQ"; //标题 pickerView.titleColor = [UIColor redColor]; //标题颜色 pickerView.unitsData = nil; //单位重置 pickerView.minDate = [NSDate new]; //最小时间 [pickerView showPicker]; //展示

关注我~ 分享更多开发经验,一起成长~ GitHub地址 GitHub地址 GitHub地址


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #iOS #时间选择器