RCalendarPicker 1.1.3

RCalendarPicker 1.1.3

测试已测试
语言语言 Obj-CObjective C
许可 MIT
发布上次发布2016年11月

roycms 维护。



 
依赖
Masonry>= 0
RGB>= 0
 

  • 作者
  • roycms

RCalendarPicker 日历控件,日期选择控件,日历,日期选择,时钟选择控件。日历控件,日历选择控件,日历,日期选择,时钟选择控件

预览

预览1 预览1

运行

cd myfinder
git clone https://github.com/roycms/RCalendarPicker.git
cd RCalendarPicker
run pod install 
xcode open RCalendarPicker.xcworkspace

使用说明文件

介绍头文件

#import "RCalendarPickerView.h" // The calendar 
#import "RClockPickerView.h" // A clock dial effect
#import "DateHelper.h" // Time processing with the help of the class

日历

默认:MainScreenWidth = 360 MainScreenHeight = 960

 RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];
            calendarPicker.today = [NSDate date]; //现在时间
            calendarPicker.date = calendarPicker.today; //选择时间
            calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){
                NSLog(@"%d-%d-%d", (int)year,(int)month,(int)day);
            };
            [self.view addSubview:calendarPicker];

农历

RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]init];
calendarPicker.isLunarCalendar = YES; //开启农历

一个时钟指针效果

 RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)
                                                                            clockRadius:140
                                                                 clockCalibrationRadius:130];
            rClockPickerView.date = [NSDate date];
            rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon){
                NSLog(@"%d-%d-%d", (int)hours,(int)minutes,(int)noon);

            };
            [self.view addSubview:rClockPickerView];

日历 + 时钟的使用

RCalendarPickerView *calendarPicker = [[RCalendarPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)];
            calendarPicker.today = [NSDate date]; //现在时间
            calendarPicker.date = calendarPicker.today; //选择时间
            [self.view addSubview:calendarPicker];

            calendarPicker.complete = ^(NSInteger day, NSInteger month, NSInteger year, NSDate *date){
                NSLog(@"%d-%d-%d", (int)year,(int)month,(int)day);

                RClockPickerView *rClockPickerView = [[RClockPickerView alloc]initWithFrame:CGRectMake(0, 0, MainScreenWidth, MainScreenHeight)
                                                                                clockRadius:140
                                                                     clockCalibrationRadius:130];
                rClockPickerView.date = [NSDate date];
                rClockPickerView.complete = ^(NSInteger hours, NSInteger minutes, NSInteger noon){
                    NSLog(@"%d-%d-%d", (int)hours,(int)minutes,(int)noon);

                    NSDate *selectDate = [DateHelper dateInDate:date Hours:hours>12?hours%12:hours minutes:minutes];

                    NSLog(@"selectDate: %@",selectDate);

                };
                [self.view addSubview:rClockPickerView];
            };

待办事项

  • 增加选择年月的切换形式