forked from klazuka/Kal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKalDataSource.m
58 lines (45 loc) · 1.35 KB
/
KalDataSource.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
* Copyright (c) 2009 Keith Lazuka
* License: http://www.opensource.org/licenses/mit-license.html
*/
#import "KalDataSource.h"
#import "KalPrivate.h"
@implementation SimpleKalDataSource
+ (SimpleKalDataSource*)dataSource
{
return [[[[self class] alloc] init] autorelease];
}
#pragma mark UITableViewDataSource protocol conformance
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = @"MyCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if (!cell) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier] autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
cell.textLabel.text = @"Filler text";
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 0;
}
#pragma mark KalDataSource protocol conformance
- (void)presentingDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate delegate:(id<KalDataSourceCallbacks>)delegate
{
[delegate loadedDataSource:self];
}
- (NSArray *)markedDatesFrom:(NSDate *)fromDate to:(NSDate *)toDate
{
return [NSArray array];
}
- (void)loadItemsFromDate:(NSDate *)fromDate toDate:(NSDate *)toDate
{
// do nothing
}
- (void)removeAllItems
{
// do nothing
}
@end