terminal logs fixed |
||
|---|---|---|
| TUCalendar | ||
| .gitignore | ||
| README.md | ||
| TUCalendar.podspec | ||
README.md
TUCalendar
Customizeable Gregorian calendar with monday as first day of week
How to use:
Required:
- Create UIViewController in storyboard or xib
- Add UITableView inside this controller
- Create outlet connection to
tableView - Implement
TUCalendarViewControllerDelegatein custom class and assign instance of that class to propertycalendarDelegateofTUCalendarViewController
Optionally:
- Create label inside controller
- Create outlet connection to
navbarTitleLabel - Add localization for
common_calendar_departure_titleandcommon_calendar_arrival_titlestrings
How to customize:
Customization can be done via two classes:
Each class contains properties that can be modified:
TUCalendarDayViewAppearance customization properties:
@property (nonatomic, nonnull) UIColor *highlightedBackgroundColor;
@property (nonatomic, nonnull) UIColor *selectedBackgroundColor;
@property (nonatomic, nonnull) UIImage *highlightedBackgroundImage;
@property (nonatomic, nonnull) UIImage *selectedBackgroundImage;
@property (nonatomic, nonnull) UIFont *titleFont;
@property (nonatomic, nonnull) UIColor *titleColor;
@property (nonatomic, nonnull) UIColor *hightlightedTitleColor;
@property (nonatomic, nonnull) UIColor *disabledTitleColor;
@property (nonatomic, nonnull) UIFont *todayTitleFont;
@property (nonatomic, nonnull) UIColor *todayTitleColor;
@property (nonatomic, nonnull) NSString *todayText;
@property (nonatomic, nonnull) UIColor *backgroundColor;
TUCalendarMonthSectionViewAppearance customization properties:
@property (nonatomic, nonnull) UIFont *titleFont;
@property (nonatomic, nonnull) UIColor *titleColor;
@property (nonatomic, nonnull) UIFont *dayFont;
@property (nonatomic, nonnull) UIColor *weekdayColor;
@property (nonatomic, nonnull) UIColor *weekendColor;
@property (nonatomic, nonnull) UIColor *dividerColor;
@property (nonatomic, nonnull) UIColor *backgroundColor;
Instances of appearance classes contains default values:
So, you can use their with the following way:
TUCalendarDayViewAppearance *dayViewAppearance = [TUCalendarDayViewAppearance new];
dayViewAppearance.titleFont = [TUFont firaSansRegularOfSize:18.f];
dayViewAppearance.todayTitleFont = [TUFont firaSansLightOfSize:10.f];
[TUCalendarDayView appearance].dayViewAppearance = dayViewAppearance;
TUCalendarMonthSectionViewAppearance *monthSectionViewAppearance = [TUCalendarMonthSectionViewAppearance new];
monthSectionViewAppearance.titleFont = [TUFont firaSansRegularOfSize:15.f];
monthSectionViewAppearance.dayFont = [TUFont firaSansRegularOfSize:11.f];
[TUCalendarMonthSectionView appearance].monthSectionAppearance = monthSectionViewAppearance;