-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathAKTableViewContent.h
54 lines (41 loc) · 1.62 KB
/
AKTableViewContent.h
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
//
// TPTableViewContent.h
//
// Created by Thiago Peres on 12/21/11.
// Copyright (c) 2011 Thiago Peres. All rights reserved.
//
#import <Foundation/Foundation.h>
#define kNoIdentifier @"noId"
#define kCellKey @"cell"
#define kCellsKey @"cells"
#define kTitleKey @"title"
#define kCellIdKey @"cellId"
@interface NSMutableArray (AKTableViewContent)
// Creation
- (NSInteger)createSectionWithTitle:(NSString*)title;
- (void)createSectionAtIndex:(NSInteger)section title:(NSString*)title;
// Adding cells
- (void)addCell:(id)cell;
- (void)addCell:(id)cell withIdentifier:(NSString*)identifier;
- (void)addCell:(id)cell forSection:(NSInteger)section;
- (void)addCell:(id)cell forSection:(NSInteger)section withIdentifier:(NSString*)identifier;
- (void)addCells:(NSArray*)cells forSection:(NSInteger)section;
// Retrieving
- (NSArray*)allCells;
- (BOOL)containsCellWithIdentifier:(NSString*)identifier;
- (id)cellForIdentifier:(NSString*)identifier;
- (NSArray*)cellsForIdentifier:(NSString*)identifier;
- (NSString*)titleForSection:(NSInteger)section;
- (NSMutableArray*)cellsForSection:(NSInteger)section;
- (NSInteger)sectionForCellWithIdentifier:(NSString*)identifier;
- (NSInteger)numberOfCellsForSection:(NSInteger)section;
- (id)cellForSection:(NSInteger)section row:(NSInteger)row;
- (id)cellForIndexPath:(NSIndexPath*)indexPath;
- (NSIndexPath*)indexPathForCell:(id)cell;
- (NSIndexPath*)indexPathForIdentifier:(NSString*)identifier;
- (NSString*)identifierForIndexPath:(NSIndexPath*)indexPath;
// Removing
- (void)removeCellsForSection:(NSInteger)section;
- (void)removeSectionAtIndex:(NSInteger)section;
- (void)removeAllSections;
@end