HSDatePickerViewController 1.0.4

HSDatePickerViewController 1.0.4

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布最后发布2016年2月

Kamil Powąłowski 维护。




HSDatePickerViewController 是一个基于 Dropbox Mailbox 应用程序的优美外观和感觉的 iOS ViewController,用于日期和时间选择,并提供一些自定义选项。

HSDatePickerViewController screen HSDatePickerViewController screen

用法

使用 CocoaPods

pod 'HSDatePickerViewController', '~> 1.0'

或从 HSDatePickerViewControllerDemo/HSDatePickerViewController 子文件夹添加源代码到您的项目中。

导入主头文件

#import "HSDatePickerViewController.h"

需要时,创建 HSDatePickerViewController 对象

HSDatePickerViewController *hsdpvc = [[HSDatePickerViewController alloc] init];

将其作为模态视图控制器展示

[self presentViewController:hsdpvc animated:YES completion:nil];

要获取返回值,必须遵守 HSDatePickerViewControllerDelegate 协议

@protocol HSDatePickerViewControllerDelegate <NSObject>
- (void)hsDatePickerPickedDate:(NSDate *)date;
@optional
- (void)hsDatePickerWillDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
- (void)hsDatePickerDidDismissWithQuitMethod:(HSDatePickerQuitMethod)method;
@end

此外,在展示 HSDatePickerViewController 之前,您可以更改一些属性的默认值(检查 HSDatePickerViewController.h 文件以获取更详细的描述)

@property (nonatomic, assign, getter=shouldDismissOnCancelTouch) BOOL dismissOnCancelTouch;

@property (nonatomic, assign) HSDatePickerMinutesStep minuteStep;

@property (nonatomic, strong) UIColor *mainColor;

@property (nonatomic, strong) NSDate *date;
@property (nonatomic, strong) NSDate *minDate;
@property (nonatomic, strong) NSDate *maxDate;

@property (nonatomic, strong) NSDateFormatter *dateFormatter;
@property (nonatomic, strong) NSDateFormatter *monthAndYearLabelDateFormater;

@property (nonatomic, strong) NSString *confirmButtonTitle;
@property (nonatomic, strong) NSString *backButtonTitle;

许可证 (MIT)

版权所有 (c) 2015 Kamil Prólowski @kamilpowalowski

查看许可证,请参阅 LICENCE 文件。