CYYSubsectionTableViewProxyDataSource Protocol Reference
Conforms to | NSObject |
Declared in | CYYSubsectionTableViewDataSource.h |
Tasks
-
– numberOfGroupsInTableView:
Asks the data source to return the number of Groups in the tableView
required method -
– tableView:numberOfSubgroupsInGroup:
Ask the data source to return the number of Subgroups in the given group
required method -
– tableView:numberOfRowsInSubgroup:ofGroup:
Asks the data source to return the number of rows in the given subgroup of the given group.
required method -
– tableView:cellForRowAtThreeComponentIndexPath:
Asks the data source for a tableViewCell for the row identified by a three-component index path
required method -
– tableView:headerForSubGroupAtIndexPath:
Asks the data source to provide a custom header view
-
– tableView:heightForHeaderForSubgroupAtIndexPath:
Asks the
delegatedata source for the height to use for the header of the given subgroup -
– tableView:titleForHeaderForSubgroupAtIndexPath:
Asks the data source for the title of the header for the group or subgroup at the given index path
Instance Methods
numberOfGroupsInTableView:
Asks the data source to return the number of Groups in the tableView
- (NSUInteger)numberOfGroupsInTableView:(UITableView *)tableView
Parameters
- tableView
The table view requesting this information.
Return Value
The number of groups in tableView
Declared In
CYYSubsectionTableViewDataSource.h
tableView:cellForRowAtThreeComponentIndexPath:
Asks the data source for a tableViewCell for the row identified by a three-component index path
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtThreeComponentIndexPath:(NSIndexPath *)indexPath
Parameters
- tableView
The table view requesting the cell.
- indexPath
A three-component index path (Group, Subgroup, Row) identifying the row.
Return Value
A table view cell.
Discussion
Don’t forget to look at NSIndexPath+TableViewWithSubSections.h for easy three-component index paths.
Declared In
CYYSubsectionTableViewDataSource.h
tableView:headerForSubGroupAtIndexPath:
Asks the data source to provide a custom header view
- (UIView *)tableView:(UITableView *)tableView headerForSubGroupAtIndexPath:(NSIndexPath *)indexPath
Parameters
- tableView
The tableView requesting the header view
- indexPath
An index path specifying the group and subgroup for this header
Return Value
a header view
Declared In
CYYSubsectionTableViewDataSource.h
tableView:heightForHeaderForSubgroupAtIndexPath:
Asks the delegate data source for the height to use for the header of the given subgroup
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderForSubgroupAtIndexPath:(NSIndexPath *)indexPath
Parameters
- tableView
The tableView requesting the header view
- indexPath
An index path specifying the group and subgroup for this header
Return Value
A floating-point value that specifies the height (in points) of the header for the group or subgroup.
Declared In
CYYSubsectionTableViewDataSource.h
tableView:numberOfRowsInSubgroup:ofGroup:
Asks the data source to return the number of rows in the given subgroup of the given group.
- (NSUInteger)tableView:(UITableView *)tableview numberOfRowsInSubgroup:(NSUInteger)subgroup ofGroup:(NSUInteger)group
Parameters
- subgroup
An index number identifying the subgroup.
- group
An index number identifying the group
- tableView
The table view requesting this information.
Return Value
The number of rows in the given subgroup of the given group
Declared In
CYYSubsectionTableViewDataSource.h
tableView:numberOfSubgroupsInGroup:
Ask the data source to return the number of Subgroups in the given group
- (NSUInteger)tableView:(UITableView *)tableview numberOfSubgroupsInGroup:(NSUInteger)group
Parameters
- group
An index number identifying the Group in the table view
- tableView
The table view requesting this information.
Return Value
The number of groups in the table view.
Declared In
CYYSubsectionTableViewDataSource.h
tableView:titleForHeaderForSubgroupAtIndexPath:
Asks the data source for the title of the header for the group or subgroup at the given index path
- (NSString *)tableView:(UITableView *)tableView titleForHeaderForSubgroupAtIndexPath:(NSIndexPath *)indexPath
Parameters
- tableView
The tableView requesting the header view
- indexPath
An index path specifying the group and subgroup for this header
Return Value
A string or nil if you’d like no title.
Declared In
CYYSubsectionTableViewDataSource.h