-
Notifications
You must be signed in to change notification settings - Fork 533
/
JTCalendarDelegate.h
115 lines (81 loc) · 2.96 KB
/
JTCalendarDelegate.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// JTCalendarDelegate.h
// JTCalendar
//
// Created by Jonathan Tribouharet
//
#import <UIKit/UIKit.h>
#import "JTCalendarPage.h"
#import "JTCalendarWeek.h"
#import "JTCalendarWeekDay.h"
#import "JTCalendarDay.h"
@class JTCalendarManager;
@protocol JTCalendarDelegate <NSObject>
@optional
// Menu view
/*!
* Provide a UIView, used as page for the menuView.
* Return an instance of `UILabel` by default.
*/
- (UIView *_Nullable)calendarBuildMenuItemView:(JTCalendarManager *_Nullable)calendar;
/*!
* Used to customize the menuItemView.
* Set text attribute to the name of the month by default.
*/
- (void)calendar:(JTCalendarManager *_Nullable)calendar prepareMenuItemView:(UIView *_Nullable)menuItemView date:(NSDate *_Nullable)date;
// Content view
/*!
* Indicate if the calendar can go to this date.
* Return `YES` by default.
*/
- (BOOL)calendar:(JTCalendarManager *_Nullable)calendar canDisplayPageWithDate:(NSDate *_Nullable)date;
/*!
* Provide the date for the previous page.
* Return 1 month before the current date by default.
*/
- (NSDate *_Nullable)calendar:(JTCalendarManager *_Nullable)calendar dateForPreviousPageWithCurrentDate:(NSDate *_Nullable)currentDate;
/*!
* Provide the date for the next page.
* Return 1 month after the current date by default.
*/
- (NSDate *_Nullable)calendar:(JTCalendarManager *_Nullable)calendar dateForNextPageWithCurrentDate:(NSDate *_Nullable)currentDate;
/*!
* Indicate the previous page became the current page.
*/
- (void)calendarDidLoadPreviousPage:(JTCalendarManager *_Nullable)calendar;
/*!
* Indicate the next page became the current page.
*/
- (void)calendarDidLoadNextPage:(JTCalendarManager *_Nullable)calendar;
/*!
* Provide a view conforming to `JTCalendarPage` protocol, used as page for the contentView.
* Return an instance of `JTCalendarPageView` by default.
*/
- (UIView<JTCalendarPage> *_Nullable)calendarBuildPageView:(JTCalendarManager *_Nullable)calendar;
// Page view
/*!
* Provide a view conforming to `JTCalendarWeekDay` protocol.
* Return an instance of `JTCalendarWeekDayView` by default.
*/
- (UIView<JTCalendarWeekDay> *_Nullable)calendarBuildWeekDayView:(JTCalendarManager *_Nullable)calendar;
/*!
* Provide a view conforming to `JTCalendarWeek` protocol.
* Return an instance of `JTCalendarWeekView` by default.
*/
- (UIView<JTCalendarWeek> *_Nullable)calendarBuildWeekView:(JTCalendarManager *_Nullable)calendar;
// Week view
/*!
* Provide a view conforming to `JTCalendarDay` protocol.
* Return an instance of `JTCalendarDayView` by default.
*/
- (UIView<JTCalendarDay> *_Nullable)calendarBuildDayView:(JTCalendarManager *_Nullable)calendar;
// Day view
/*!
* Used to customize the dayView.
*/
- (void)calendar:(JTCalendarManager *_Nullable)calendar prepareDayView:(UIView<JTCalendarDay> *_Nullable)dayView;
/*!
* Indicate the dayView just get touched.
*/
- (void)calendar:(JTCalendarManager *_Nullable)calendar didTouchDayView:(UIView<JTCalendarDay> *_Nullable)dayView;
@end