Inherits from TSQCalendarCell : UITableViewCell
Declared in TSQCalendarRowCell.h
TSQCalendarRowCell.m

Overview

The TSQCalendarRowCell class is a cell that represents one week in the calendar.

Each of the seven columns can represent a day that’s in this month, a day that’s not in this month, a selected day, today, or an unselected day. The cell uses several images placed strategically to achieve the effect.

Properties

backgroundImage

The background image for the entire row.

@property (nonatomic, weak, readonly) UIImage *backgroundImage

Discussion

This image should be as wide as the entire view and include the grid lines between the columns. It will probably also include the grid line at the top of the row, but not the one at the bottom.

You might, however, return a different image that includes both the grid line at the top and the one at the bottom if the bottomRow property is set to YES. You might even adjust the cellHeight.

Declared In

TSQCalendarRowCell.h

beginningDate

The date at the beginning of the week for this cell.

@property (nonatomic, strong) NSDate *beginningDate

Discussion

Notice that it might be before the firstOfMonth property or it might be after.

Declared In

TSQCalendarRowCell.h

bottomRow

Whether this cell is the bottom row / last week for the month.

@property (nonatomic, getter=isBottomRow) BOOL bottomRow

Discussion

You may find yourself using a different background image or laying out differently in the last row.

Declared In

TSQCalendarRowCell.h

notThisMonthBackgroundImage

The background image for a day that’s not this month.

@property (nonatomic, weak, readonly) UIImage *notThisMonthBackgroundImage

Discussion

These are the trailing days from the previous month or the leading days from the following month. This can be nil.

Declared In

TSQCalendarRowCell.h

selectedBackgroundImage

The background image for a day that’s selected.

@property (nonatomic, weak, readonly) UIImage *selectedBackgroundImage

Discussion

This is blue in the system’s built-in Calendar app. You probably want to use a stretchable image.

Declared In

TSQCalendarRowCell.h

todayBackgroundImage

The background image for a day that’s “today”.

@property (nonatomic, weak, readonly) UIImage *todayBackgroundImage

Discussion

This is dark gray in the system’s built-in Calendar app. You probably want to use a stretchable image.

Declared In

TSQCalendarRowCell.h

Instance Methods

initWithCalendar:reuseIdentifier:

Initializes the cell.

- (id)initWithCalendar:(NSCalendar *)calendar reuseIdentifier:(NSString *)reuseIdentifier

Parameters

calendar

The NSCalendar the cell is representing

reuseIdentifier

A string reuse identifier, as used by UITableViewCell

Declared In

TSQCalendarCell.h

layoutViewsForColumnAtIndex:inRect:

- (void)layoutViewsForColumnAtIndex:(NSUInteger)index inRect:(CGRect)rect

Declared In

TSQCalendarCell.h

selectColumnForDate:

Method to select a specific date within the week.

- (void)selectColumnForDate:(NSDate *)date

Parameters

date

The date to select, or nil to deselect all columns.

Discussion

This is funneled through and called by the calendar view, to facilitate deselection of other rows.

Declared In

TSQCalendarRowCell.h

setFirstOfMonth:

The first day of the month this cell is currently representing.

- (void)setFirstOfMonth:(NSDate *)firstOfMonth

Discussion

This can be useful for calculations and for display.

Declared In

TSQCalendarCell.h