日历多选问题iOS

时间:2016-01-21 11:45:10

标签: ios objective-c iphone nscalendar

我在这里使用RSDayFlow日历Code .I实现成功,但我需要选择多个日期如何实现。我试图选择多个日期开始和结束日期,但我无法显示。这是我的代码

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    RSDFDatePickerView *datePickerView = [[RSDFDatePickerView alloc] initWithFrame:self.view.bounds];
    datePickerView.delegate = self;
    datePickerView.dataSource = self;

    [self.view addSubview:datePickerView];
}

- (void)initWithFrame:(CGRect)frame calendar:(NSCalendar *)calendar startDate:(NSDate *)startDate endDate:(NSDate *)endDate
{

 // here the code What i need to select Start and End dates   


}
// Returns YES if the date should be highlighted or NO if it should not.
- (BOOL)datePickerView:(RSDFDatePickerView *)view shouldHighlightDate:(NSDate *)date
{

    return YES;
}

// Returns YES if the date should be selected or NO if it should not.
- (BOOL)datePickerView:(RSDFDatePickerView *)view shouldSelectDate:(NSDate *)date
{

    return YES;
}

// Prints out the selected date.
- (void)datePickerView:(RSDFDatePickerView *)view didSelectDate:(NSDate *)date
{
    NSLog(@"%@", [date description]);

}

请你帮忙,对我来说是个大忙。

1 个答案:

答案 0 :(得分:0)

使用此版本的RSDayFlow支持多种选择模式:https://github.com/aryaxt/RSDayFlow/tree/AG/SelectionMode