Go to file
Grigory 111ee5c6fd Merge pull request #2 from TouchInstinct/bugfix/terminalLogs
terminal logs fixed
2016-12-16 17:00:36 +03:00
TUCalendar terminal logs fixed 2016-12-16 16:57:25 +03:00
.gitignore Initial commit 2016-11-14 13:32:19 +03:00
README.md Add some documentation 2016-11-22 15:31:03 +03:00
TUCalendar.podspec terminal logs fixed 2016-12-16 16:57:25 +03:00

README.md

TUCalendar

Customizeable Gregorian calendar with monday as first day of week

How to use:

Required:

  1. Create UIViewController in storyboard or xib
  2. Add UITableView inside this controller
  3. Create outlet connection to tableView
  4. Implement TUCalendarViewControllerDelegate in custom class and assign instance of that class to property calendarDelegate of TUCalendarViewController

Optionally:

  1. Create label inside controller
  2. Create outlet connection to navbarTitleLabel
  3. Add localization for common_calendar_departure_title and common_calendar_arrival_title strings

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;