LDCalendar
支持跨月多选日期的轻量级日历 通俗易懂
Install / Use
/learn @SNTD/LDCalendarREADME
工作中需要用到多选的日历,网上搜索后多是单选日历, 于是写了个简单的日历选择器(点击跳转 Swift版LDCalendarSwift):
1.今天用红框标注,只能选择今天以后的工作日期,支持跨月份多选
2.因为每个月的第一天在第一行,所以有时候需要6行才能显示,仿照铁路12306的日历,显示了6行, 选择点击下一个月的日期时会自动切到下一个月,但是可以直接在当前月取消。
3.本日历是基于手势点击切换按钮状态的,用UIButton 的Normal Disable Selected 三种状态代码还可以更简单一点(Swift版实现原理),当初用手势主要是为了以后可以扩展处理3种以上的状态。
日历效果演示

功能说明:
详情可查看Demo中代码
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
self.calendarView.defaultDays = _seletedDays;
[self.calendarView show];
}
- (LDCalendarView *)calendarView {
if (!_calendarView) {
_calendarView = [[LDCalendarView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH,SCREEN_HEIGHT)];
[self.view addSubview:_calendarView];
__weak typeof(self) weakSelf = self;
_calendarView.complete = ^(NSArray *result) {
if (result) {
weakSelf.seletedDays = result.mutableCopy;
[weakSelf.tableView reloadData];
}
};
}
return _calendarView;
}
Support : iOS6 +
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
