MXKDataSource refactoring

Table view cell are now defined at view controller level.
This commit is contained in:
giomfo
2015-12-07 11:50:13 +01:00
parent 5d484d9a63
commit ef69af9adb
5 changed files with 52 additions and 22 deletions
@@ -17,6 +17,8 @@
#import "RecentsViewController.h"
#import "RoomViewController.h"
#import "RecentTableViewCell.h"
#import "RageShakeManager.h"
#import "NSBundle+MatrixKit.h"
@@ -76,6 +78,9 @@
// The view controller handles itself the selected recent
self.delegate = self;
// Register here the customized cell view class used to render recents
[self.recentsTableView registerNib:RecentTableViewCell.nib forCellReuseIdentifier:RecentTableViewCell.defaultReuseIdentifier];
}
- (void)dealloc
@@ -417,6 +422,18 @@
#pragma mark - MXKDataSourceDelegate
- (Class<MXKCellRendering>)cellViewClassForCellData:(MXKCellData*)cellData
{
// Return the customized recent table view cell
return RecentTableViewCell.class;
}
- (NSString *)cellReuseIdentifierForCellData:(MXKCellData*)cellData
{
// Return the customized recent table view cell identifier
return RecentTableViewCell.defaultReuseIdentifier;
}
- (void)dataSource:(MXKDataSource *)dataSource didCellChange:(id)changes
{
[self.recentsTableView reloadData];