IOS打卡日历、可做签到等功能
应用介绍
作者laoou002,源码LOCalendar,LOCalendar 打卡日历、可做签到等功能的参考。
使用方法:
//打卡日期 NSArray *dakaArray = @[@"2019-12-01",@"2019-12-02",@"2020-01-01"]; self.calendarView = [[LOCalendarView alloc] initWithDakaArray:dakaArray frame:CGRectMake(15, 80, [UIScreen mainScreen].bounds.size.width-30, 300)]; [self.view addSubview:self.calendarView]; //圆角及边框样式(根据个人情况调整) self.calendarView.layer.cornerRadius = 10; self.calendarView.layer.borderColor = [UIColor lightGrayColor].CGColor; self.calendarView.layer.borderWidth = 2; typeof(self) __weak weakSelf = self; //调整高度 [self.calendarView setReHeightBlock:^(CGFloat height) { }]; //修改月份 [self.calendarView setChangeBlock:^(NSDate * _Nonnull date) { }]; //点击回调 [self.calendarView setSelectBlock:^(NSDate *date, LODayButtonType type) { if (type==LODayButtonTypeDisabled) { [LOToastView showWithMsg:@"不在打卡范围"]; } else if (type==LODayButtonTypeBuKa) { //标记为已打卡 [weakSelf.calendarView addDate:date]; [LOToastView showWithMsg:@"补卡成功"]; } else if (type==LODayButtonTypeYiDaKa) { [LOToastView showWithMsg:@"已打卡"]; } }]; //可补卡范围(默认为本周) self.calendarView.bukaRange = 30; //刷新UI [self.calendarView reloadUI];

©软件著作权归作者所有。本站所有内容均来源于网络,不得违法使用,仅供学习使用,请支持正版!
转载请注明出处: 662P » IOS打卡日历、可做签到等功能
发表评论 取消回复