TestsTested | ✓ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Oct 2016 |
Maintained by Jérôme Morissard.
JMOTableViewDescription is an Objective-C library for easily creating and manage complex structured tableView.
Why this project?
This project present:
NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this iOS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.
JMODemoTableViewDescription *desc = [JMODemoTableViewDescription new];
JMOTableViewSectionDescription *oneSection = [JMOTableViewSectionDescription new];
JMOTableViewRowDescription *oneRow = [JMOTableViewRowDescription new];
oneRow.cellClass = [UITableViewCell class];
oneRow.cellHeight = 30.0f;
oneRow.cellReuseIdentifier = @"UITableViewCellIdentifier";
oneRow.data = @"My Fake 1st section (it's a cell!)";
[oneSection addRowDescription:oneRow];
...
return desc;
@protocol JMOTableViewDescriptionCellUpdate <NSObject>
@optional
- (void)updateCellWithData:(id)data;
- (void)updateCellWithRowDescription:(id)data;
@end
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [super tableView:tableView cellForRowAtIndexPath:indexPath];
//You can manage your own custom update
if (cell.class == UITableViewCell.class) {
JMOTableViewRowDescription *rowDesc = [self.tableViewDescription rowDescriptionForIndexPath:indexPath];
cell.textLabel.text = rowDesc.data;
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectDataDescription:(id)selectedData
{
JMOLog(@"Do something with selectedData : %@",selectedData);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"TableViewDescriptionDelegate" message:@"Do something with selected Data" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles: nil];
[alert show];
}