TSQCalendarRowCell Class Reference
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.
Tasks
Images
-
backgroundImage
property -
selectedBackgroundImage
property -
todayBackgroundImage
property -
notThisMonthBackgroundImage
property
State Properties Set by Calendar View
-
beginningDate
property -
bottomRow
property -
– selectColumnForDate:
Other Methods
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
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