Public rooms search: Directory page starts to work (with cells from MatrixKit)

This commit is contained in:
manuroe
2015-12-18 17:17:03 +01:00
parent 10de4757d3
commit e71a4a090d
11 changed files with 108 additions and 37 deletions
@@ -16,6 +16,8 @@
#import "PublicRoomsDirectoryDataSource.h"
#import "MXKPublicRoomTableViewCell.h"
#pragma mark - Constants definitions
// Time in seconds from which public rooms data is considered as obsolete
@@ -124,4 +126,26 @@ double const kPublicRoomsDirectoryDataExpiration = 10;
}
}
#pragma mark - UITableViewDataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _filteredRooms.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
// For now reuse MatrixKit cells
// TODO: use custom cells and manage a mechanism a la MatrixKit with cellData
MXKPublicRoomTableViewCell *publicRoomCell = [tableView dequeueReusableCellWithIdentifier:[MXKPublicRoomTableViewCell defaultReuseIdentifier]];
if (!publicRoomCell)
{
publicRoomCell = [[MXKPublicRoomTableViewCell alloc] init];
}
[publicRoomCell render:_filteredRooms[indexPath.row]];
return publicRoomCell;
}
@end