Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions JTCalendar/JTCalendarDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTCalendarDelegate <NSObject>

@optional
Expand Down Expand Up @@ -113,3 +114,4 @@
- (void)calendar:(JTCalendarManager *)calendar didTouchDayView:(UIView<JTCalendarDay> *)dayView;

@end
NS_ASSUME_NONNULL_END
8 changes: 5 additions & 3 deletions JTCalendar/JTCalendarManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@
#import "JTCalendarDelegateManager.h"
#import "JTCalendarScrollManager.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarManager : NSObject

@property (nonatomic, weak) id<JTCalendarDelegate> delegate;
@property (nonatomic, weak, nullable) id<JTCalendarDelegate> delegate;

@property (nonatomic, weak) UIView<JTMenu> *menuView;
@property (nonatomic, weak) UIScrollView<JTContent> *contentView;
@property (nonatomic, weak, nullable) UIView<JTMenu> *menuView;
@property (nonatomic, weak, nullable) UIScrollView<JTContent> *contentView;

@property (nonatomic, readonly) JTDateHelper *dateHelper;
@property (nonatomic, readonly) JTCalendarSettings *settings;
Expand All @@ -42,3 +43,4 @@


@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/JTCalendarSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ typedef NS_ENUM(NSInteger, JTCalendarWeekDayFormat) {
JTCalendarWeekDayFormatFull
};

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarSettings : NSObject


Expand All @@ -38,3 +39,4 @@ typedef NS_ENUM(NSInteger, JTCalendarWeekDayFormat) {
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
14 changes: 8 additions & 6 deletions JTCalendar/JTDateHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
@interface JTDateHelper : NSObject

- (NSCalendar *)calendar;
- (NSDateFormatter *)createDateFormatter;

- (NSDate *)addToDate:(NSDate *)date months:(NSInteger)months;
- (NSDate *)addToDate:(NSDate *)date weeks:(NSInteger)weeks;
- (NSDate *)addToDate:(NSDate *)date days:(NSInteger)days;
- (nullable NSDate *)addToDate:(NSDate *)date months:(NSInteger)months;
- (nullable NSDate *)addToDate:(NSDate *)date weeks:(NSInteger)weeks;
- (nullable NSDate *)addToDate:(NSDate *)date days:(NSInteger)days;

// Must be less or equal to 6
- (NSUInteger)numberOfWeeks:(NSDate *)date;

- (NSDate *)firstDayOfMonth:(NSDate *)date;
- (NSDate *)firstWeekDayOfMonth:(NSDate *)date;
- (NSDate *)firstWeekDayOfWeek:(NSDate *)date;
- (nullable NSDate *)firstDayOfMonth:(NSDate *)date;
- (nullable NSDate *)firstWeekDayOfMonth:(NSDate *)date;
- (nullable NSDate *)firstWeekDayOfWeek:(NSDate *)date;

- (BOOL)date:(NSDate *)dateA isTheSameMonthThan:(NSDate *)dateB;
- (BOOL)date:(NSDate *)dateA isTheSameWeekThan:(NSDate *)dateB;
Expand All @@ -32,3 +33,4 @@
- (BOOL)date:(NSDate *)date isEqualOrAfter:(NSDate *)startDate andEqualOrBefore:(NSDate *)endDate;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Managers/JTCalendarDelegateManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

// Provide a default behavior when no delegate are provided

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarDelegateManager : NSObject

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

// Menu view

Expand Down Expand Up @@ -46,3 +47,4 @@
- (void)didTouchDayView:(UIView<JTCalendarDay> *)dayView;

@end
NS_ASSUME_NONNULL_END
9 changes: 5 additions & 4 deletions JTCalendar/Managers/JTCalendarScrollManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
#import "JTContent.h"

// Synchronize JTHorizontalCalendarView and JTCalendarMenuView

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarScrollManager : NSObject

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic, weak) UIView<JTMenu> *menuView;
@property (nonatomic, weak) UIScrollView<JTContent> *horizontalContentView;
@property (nonatomic, weak, nullable) UIView<JTMenu> *menuView;
@property (nonatomic, weak, nullable) UIScrollView<JTContent> *horizontalContentView;

- (void)setMenuPreviousDate:(NSDate *)previousDate
currentDate:(NSDate *)currentDate
Expand All @@ -29,3 +29,4 @@
- (void)updateHorizontalContentOffset:(CGFloat)percentage;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTCalendarDay.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTCalendarDay <NSObject>

- (void)setManager:(JTCalendarManager *)manager;
Expand All @@ -20,3 +21,4 @@
- (void)setIsFromAnotherMonth:(BOOL)isFromAnotherMonth;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTCalendarPage.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTCalendarPage <NSObject>

- (void)setManager:(JTCalendarManager *)manager;
Expand All @@ -19,3 +20,4 @@
- (void)reload;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTCalendarWeek.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTCalendarWeek <NSObject>

- (void)setManager:(JTCalendarManager *)manager;
Expand All @@ -17,3 +18,4 @@
- (void)setStartDate:(NSDate *)startDate updateAnotherMonth:(BOOL)enable monthDate:(NSDate *)monthDate;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTCalendarWeekDay.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTCalendarWeekDay <NSObject>

- (void)setManager:(JTCalendarManager *)manager;

- (void)reload;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTContent.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTContent <NSObject>

- (void)setManager:(JTCalendarManager *)manager;
Expand All @@ -23,3 +24,4 @@
- (void)loadNextPageWithAnimation;

@end
NS_ASSUME_NONNULL_END
2 changes: 2 additions & 0 deletions JTCalendar/Protocols/JTMenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

@class JTCalendarManager;

NS_ASSUME_NONNULL_BEGIN
@protocol JTMenu <NSObject>

- (void)setManager:(JTCalendarManager *)manager;
Expand All @@ -22,3 +23,4 @@
- (UIScrollView *)scrollView;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTCalendarDayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTCalendarDay.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarDayView : UIView<JTCalendarDay>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic) NSDate *date;

Expand All @@ -30,3 +31,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTCalendarMenuView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTMenu.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarMenuView : UIView<JTMenu, UIScrollViewDelegate>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic) CGFloat contentRatio;

Expand All @@ -23,3 +24,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTCalendarPageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTCalendarPage.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarPageView : UIView<JTCalendarPage>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic) NSDate *date;

Expand All @@ -21,3 +22,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
6 changes: 4 additions & 2 deletions JTCalendar/Views/JTCalendarWeekDayView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@

#import "JTCalendarWeekDay.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarWeekDayView : UIView<JTCalendarWeekDay>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic, readonly) NSArray *dayViews;
@property (nonatomic, readonly) NSArray<UILabel *> *dayViews;

/*!
* Must be call if override the class
Expand All @@ -26,3 +27,4 @@
- (void)reload;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTCalendarWeekView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTCalendarWeek.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTCalendarWeekView : UIView<JTCalendarWeek>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic, readonly) NSDate *startDate;

Expand All @@ -21,3 +22,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTHorizontalCalendarView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTContent.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTHorizontalCalendarView : UIScrollView<JTContent>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic) NSDate *date;

Expand All @@ -21,3 +22,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END
4 changes: 3 additions & 1 deletion JTCalendar/Views/JTVerticalCalendarView.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@

#import "JTContent.h"

NS_ASSUME_NONNULL_BEGIN
@interface JTVerticalCalendarView : UIScrollView<JTContent>

@property (nonatomic, weak) JTCalendarManager *manager;
@property (nonatomic, weak, nullable) JTCalendarManager *manager;

@property (nonatomic) NSDate *date;

Expand All @@ -21,3 +22,4 @@
- (void)commonInit;

@end
NS_ASSUME_NONNULL_END