TSQCalendarView Class Reference
| Inherits from | UIView |
| Declared in | TSQCalendarView.h TSQCalendarView.m |
Overview
The TSQCalendarView class displays a monthly calendar in a self-contained scrolling view. It supports any calendar that NSCalendar supports.
The implementation and usage are very similar to UITableView: the app provides reusable cells via a data source and controls behavior via a delegate. See TSQCalendarCell for a cell superclass.
Tasks
Date Setup
-
firstDateproperty -
lastDateproperty -
selectedDateproperty
Calendar Configuration
-
calendarproperty
Visual Configuration
-
delegateproperty -
pinsHeaderToTopproperty -
pagingEnabledproperty -
contentInsetproperty -
contentOffsetproperty -
headerCellClassproperty -
rowCellClassproperty -
– scrollToDate:animated:
Properties
calendar
The calendar type to use when displaying.
@property (nonatomic, strong) NSCalendar *calendarDiscussion
If not set, this defaults to [NSCalendar currentCalendar].
Declared In
TSQCalendarView.hcontentInset
The distance from the edges of the view to where the content begins.
@property (nonatomic) UIEdgeInsets contentInsetDiscussion
This property is equivalent to the one defined on UIScrollView.
Declared In
TSQCalendarView.hcontentOffset
The point on the calendar where the currently-visible region starts.
@property (nonatomic) CGPoint contentOffsetDiscussion
This property is equivalent to the one defined on UIScrollView.
Declared In
TSQCalendarView.hdelegate
The delegate of the calendar view.
@property (nonatomic, weak) id<TSQCalendarViewDelegate> delegateDiscussion
The delegate must adopt the TSQCalendarViewDelegate protocol.
The TSQCalendarView class, which does not retain the delegate, invokes each protocol method the delegate implements.
Declared In
TSQCalendarView.hfirstDate
The earliest month the calendar view displays.
@property (nonatomic, strong) NSDate *firstDateDiscussion
Set this property to any NSDate; TSQCalendarView will only look at the month and year.
Must be set for the calendar to be useful.
Declared In
TSQCalendarView.hheaderCellClass
The cell class to use for month headers.
@property (nonatomic, strong) Class headerCellClassDiscussion
Since there’s very little configuration to be done for each cell, this can be set as a shortcut to implementing a data source.
The class should be a subclass of TSQCalendarMonthHeaderCell or at least implement all of its methods.
Declared In
TSQCalendarView.hlastDate
The latest month the calendar view displays.
@property (nonatomic, strong) NSDate *lastDateDiscussion
Set this property to any NSDate; TSQCalendarView will only look at the month and year.
Must be set for the calendar to be useful.
Declared In
TSQCalendarView.hpagingEnabled
Whether or not the calendar snaps to begin a month at the top of its bounds.
@property (nonatomic) BOOL pagingEnabledDiscussion
This property is roughly equivalent to the one defined on UIScrollView except the snapping is to months rather than integer multiples of the view’s bounds.
Declared In
TSQCalendarView.hpinsHeaderToTop
Whether to pin the header to the top of the view.
@property (nonatomic) BOOL pinsHeaderToTopDiscussion
If you’re trying to emulate the built-in calendar app, set this to YES. Default value is NO.
Declared In
TSQCalendarView.hrowCellClass
The cell class to use for week rows.
@property (nonatomic, strong) Class rowCellClassDiscussion
Since there’s very little configuration to be done for each cell, this can be set as a shortcut to implementing a data source.
The class should be a subclass of TSQCalendarRowCell or at least implement all of its methods.
Declared In
TSQCalendarView.hselectedDate
The currently-selected date on the calendar.
@property (nonatomic, strong) NSDate *selectedDateDiscussion
Set this property to any NSDate; TSQCalendarView will only look at the month, day, and year.
You can read and write this property; the delegate method calendarView:didSelectDate: will be called both when a new date is selected from the UI and when this method is called manually.
Declared In
TSQCalendarView.hInstance Methods
scrollToDate:animated:
Scrolls the receiver until the specified date month is completely visible.
- (void)scrollToDate:(NSDate *)date animated:(BOOL)animatedParameters
- date
A date that identifies the month that will be visible.
- animated
YES if you want to animate the change in position, NO if it should be immediate.
Declared In
TSQCalendarView.h