Skip to content

Commit

Permalink
Exposed the currently selected date via the KalViewController public …
Browse files Browse the repository at this point in the history
…interface.
  • Loading branch information
klazuka committed Sep 24, 2010
1 parent d85cba0 commit 9464bf0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/KalViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
@property (nonatomic, assign) id<UITableViewDelegate> delegate;
@property (nonatomic, assign) id<KalDataSource> dataSource;

- (id)initWithSelectedDate:(NSDate *)selectedDate; // designated initializer. When the calendar is first displayed to the user, the month that contains 'selectedDate' will be shown and the corresponding tile for 'selectedDate' will be automatically selected.
- (void)reloadData; // If you change the KalDataSource after the KalViewController has already been displayed to the user, you must call this method in order for the view to reflect the new data.
- (void)showAndSelectDate:(NSDate *)date; // Updates the state of the calendar to display the specified date's month and selects the tile for that date.
- (id)initWithSelectedDate:(NSDate *)selectedDate; // designated initializer. When the calendar is first displayed to the user, the month that contains 'selectedDate' will be shown and the corresponding tile for 'selectedDate' will be automatically selected.
- (void)reloadData; // If you change the KalDataSource after the KalViewController has already been displayed to the user, you must call this method in order for the view to reflect the new data.
- (void)showAndSelectDate:(NSDate *)date; // Updates the state of the calendar to display the specified date's month and selects the tile for that date.
- (NSDate *)selectedDate; // The currently selected date. You should only use the actual date components from this NSDate object. The hours/minutes/seconds/timezones are undefined.

@end
6 changes: 6 additions & 0 deletions src/KalViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ - (void)showAndSelectDate:(NSDate *)date
[self reloadData];
}

- (NSDate *)selectedDate
{
return [self.calendarView.selectedDate NSDate];
}


// -----------------------------------------------------------------------------------
#pragma mark UIViewController

Expand Down

0 comments on commit 9464bf0

Please sign in to comment.