Skip to content

Commit

Permalink
Updated high-level comments/documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
klazuka committed Jan 3, 2010
1 parent 6489b79 commit adc881f
Show file tree
Hide file tree
Showing 17 changed files with 58 additions and 52 deletions.
11 changes: 11 additions & 0 deletions HolidaysDemo/Holiday.h
@@ -1,4 +1,15 @@
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/

/*
* Holiday
* -------
*
* An immutable value object that represents a single element
* in the dataset.
*/
@interface Holiday : NSObject
{
NSDate *date;
Expand Down
7 changes: 5 additions & 2 deletions HolidaysDemo/Holiday.m
@@ -1,5 +1,9 @@
#import "Holiday.h"
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/

#import "Holiday.h"

@implementation Holiday

Expand Down Expand Up @@ -36,5 +40,4 @@ - (void)dealloc
[super dealloc];
}


@end
16 changes: 15 additions & 1 deletion HolidaysDemo/HolidayAppDelegate.h
Expand Up @@ -5,6 +5,21 @@

#import <UIKit/UIKit.h>

/*
* HolidayAppDelegate
* ------------------
*
* This demo app shows how to use Kal to display 2009 and 2010
* world holidays. I have provided 2 example data sources:
*
* 1. HolidayJSONDataSource - fetches JSON data from the internet
* 2. HolidaySqliteDataSource - queries a local Sqlite database
*
* Both data sources use the same logical data and both present
* the data to the user in the same way (via UITableViewCells).
* The only difference is in the way that they retrieve the data.
*
*/
@interface HolidayAppDelegate : NSObject <UIApplicationDelegate>
{
UIWindow *window;
Expand All @@ -14,4 +29,3 @@
@property (nonatomic, retain) IBOutlet UIWindow *window;

@end

2 changes: 0 additions & 2 deletions HolidaysDemo/HolidayAppDelegate.m
Expand Up @@ -8,12 +8,10 @@
#import "HolidaySqliteDataSource.h"
#import "Kal.h"


@implementation HolidayAppDelegate

@synthesize window;


- (void)applicationDidFinishLaunching:(UIApplication *)application
{
// I provide several different dataSource examples. Pick one by commenting out the others.
Expand Down
12 changes: 11 additions & 1 deletion HolidaysDemo/HolidayJSONDataSource.h
@@ -1,10 +1,20 @@
/*
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/

#import "Kal.h"

/*
* HolidayJSONDataSource
* ---------------------
*
* This example data source retrieves 2009 and 2010 world holidays
* from a JSON resource located at http://keith.lazuka.org/holidays.json.
* It uses Stig Brautaset's JSON library to parse the JSON and store
* it in an array of Holiday objects.
*
*/
@interface HolidayJSONDataSource : NSObject <KalDataSource>
{
NSMutableArray *items;
Expand Down
3 changes: 1 addition & 2 deletions HolidaysDemo/HolidayJSONDataSource.m
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/
Expand Down Expand Up @@ -164,5 +164,4 @@ - (void)dealloc
[super dealloc];
}


@end
13 changes: 12 additions & 1 deletion HolidaysDemo/HolidaySqliteDataSource.h
@@ -1,10 +1,21 @@
/*
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/

#import "Kal.h"

/*
* HolidaySqliteDataSource
* ---------------------
*
* This example data source retrieves 2009 and 2010 world holidays
* from an Sqlite database stored locally in the application bundle.
* When the presentingDatesFrom:to:delegate message is received,
* it queries the database for the specified date range and
* instantiates a Holiday object for each row in the result set.
*
*/
@interface HolidaySqliteDataSource : NSObject <KalDataSource>
{
NSMutableArray *items;
Expand Down
3 changes: 1 addition & 2 deletions HolidaysDemo/HolidaySqliteDataSource.m
@@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/
Expand Down Expand Up @@ -132,5 +132,4 @@ - (void)dealloc
[super dealloc];
}


@end
2 changes: 1 addition & 1 deletion Kal/KalDataSource.h
Expand Up @@ -95,4 +95,4 @@
{
}
+ (SimpleKalDataSource*)dataSource;
@end
@end
1 change: 0 additions & 1 deletion Kal/KalGridView.m
Expand Up @@ -256,5 +256,4 @@ - (void)dealloc
[super dealloc];
}


@end
1 change: 0 additions & 1 deletion Kal/KalLogic.m
Expand Up @@ -145,5 +145,4 @@ - (void) dealloc
[super dealloc];
}


@end
1 change: 0 additions & 1 deletion Kal/KalPrivate.h
Expand Up @@ -5,4 +5,3 @@

#import "UIViewAdditions.h"
#import "NSDateAdditions.h"

1 change: 0 additions & 1 deletion Kal/KalTileView.m
Expand Up @@ -196,5 +196,4 @@ - (void)dealloc
[super dealloc];
}


@end
18 changes: 0 additions & 18 deletions Kal/KalView.m
Expand Up @@ -231,22 +231,4 @@ - (void)dealloc
[super dealloc];
}


@end

















1 change: 0 additions & 1 deletion Kal/KalViewController.h
Expand Up @@ -33,4 +33,3 @@
- (void)showAndSelectToday; // Updates the state of the calendar to display today's month and selects the tile for today's date.

@end

17 changes: 1 addition & 16 deletions Kal/KalViewController.m
Expand Up @@ -100,7 +100,7 @@ - (void)showFollowingMonth
[self fetchDataForCurrentMonth];
}

// ----------------------------------------
// -----------------------------------------
#pragma mark KalDataSourceCallbacks protocol

- (void)loadedDataSource:(id<KalDataSource>)theDataSource;
Expand Down Expand Up @@ -142,19 +142,6 @@ - (void)showAndSelectToday
[self fetchDataForCurrentMonth];
}

/*
- (void)showAndSelectToday
{
if ([[self calendarView] isSliding])
return;
[logic moveToTodaysMonth];
[[self calendarView] jumpToSelectedMonth];
[[self calendarView] selectTodayIfVisible];
[self fetchDataForCurrentMonth];
}
*/

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

Expand Down Expand Up @@ -190,6 +177,4 @@ - (void)dealloc
[super dealloc];
}


@end

1 change: 0 additions & 1 deletion Kal/UIViewAdditions.m
Expand Up @@ -79,5 +79,4 @@ - (void)setHeight:(CGFloat)height
self.frame = frame;
}


@end

0 comments on commit adc881f

Please sign in to comment.