ZBCalendarCollectionView*collection = [[ZBCalendarCollectionView alloc]initWithFrame:CGRectMake(0, 100, CGRectGetWidth(self.view.frame), 80)];
collection.selectedBlock = ^(NSDate* date){
NSDateFormatter *year = [[NSDateFormatter alloc]init];
[year setDateFormat:@"yyyy"];
NSString *yearstr = [year stringFromDate:date];
NSDateFormatter *month = [[NSDateFormatter alloc]init];
[month setDateFormat:@"MM"];
NSString *monthstr = [month stringFromDate:date];
NSDateFormatter *day = [[NSDateFormatter alloc]init];
[day setDateFormat:@"dd"];
NSString *daystr = [day stringFromDate:date];
NSLog(@"%@:%@:%@",yearstr,monthstr,daystr);
};
[self.view addSubview:collection];
-
Notifications
You must be signed in to change notification settings - Fork 0
这是一个可以左右滑动显示当前月份的日历
License
jzb4068/ZBCalendar
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|