#import "CalendarViewController.h"
#import "MyCalendarItem.h"
#import "CalendarView.h"
@interface CalendarViewController ()<CalendarViewDelegate>
@property (nonatomic,retain) CalendarView *calenderView1;
@property (nonatomic,retain) UIButton *editButton; // 正在编辑的textField
@property (weak, nonatomic) IBOutlet UIButton *earlisetDateButton; // 最早的时间
@property (weak, nonatomic) IBOutlet UIButton *latestDateButton; // 最晚的时间
@end
@implementation CalendarViewController
- (void)viewDidLoad {
#pragma mark CalendarView部分
[super viewDidLoad];
self.calenderView1.delegate = self;
}
#pragma mark 时间按钮点击事件
- (IBAction)dateButtonClick:(UIButton *)sender {
self.editButton = sender;
self.calenderView1.frame = CGRectMake(0, 100, WIDTH, 335);
self.calenderView1.hidden = NO;
if (sender == self.earlisetDateButton) {
[self.calenderView1 updateCalendarViewWithDateStyleEnum:EarlestDateStyleEnum];
} else if (sender == self.latestDateButton) {
[self.calenderView1 updateCalendarViewWithDateStyleEnum:LatestDateStyleEnum];
}
}
- (void)selectEnsureDate:(NSString *)ensureDate {
NSLog(@"ensureDate ====== %@",ensureDate);
[self.editButton setTitle:ensureDate forState:UIControlStateNormal];
}
#pragma mark view懒加载
- (CalendarView *)calenderView1 {
if (!_calenderView1) {
_calenderView1 = [[CalendarView alloc] init];
[self.view addSubview:self.calenderView1];
self.calenderView1.hidden = YES;
}
return _calenderView1;
}
@end