@@ -63,9 +63,12 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
6363}
6464
6565- (UITableViewCell *)tableView : (UITableView *)tableView cellForRowAtIndexPath : (NSIndexPath *)indexPath {
66- UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: self .cellReuseIdentifier
67- forIndexPath: indexPath];
6866 id item = [self itemAtIndexPath: indexPath];
67+ NSString * reuseIdentifier = self.cellReuseIdentifier ;
68+ if (!reuseIdentifier)
69+ reuseIdentifier = [self .delegate dataSource: self reuseIdentifierForItem: item];
70+ UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: reuseIdentifier
71+ forIndexPath: indexPath];
6972
7073 if (self.configureCellBlock ) {
7174 self.configureCellBlock (cell, item);
@@ -86,9 +89,12 @@ - (NSInteger)collectionView:(UICollectionView *)collectionView
8689- (UICollectionViewCell *)collectionView : (UICollectionView *)collectionView
8790 cellForItemAtIndexPath : (NSIndexPath *)indexPath
8891{
89- UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier: self .cellReuseIdentifier
90- forIndexPath: indexPath];
9192 id item = [self itemAtIndexPath: indexPath];
93+ NSString * reuseIdentifier = self.cellReuseIdentifier ;
94+ if (!reuseIdentifier)
95+ reuseIdentifier = [self .delegate dataSource: self reuseIdentifierForItem: item];
96+ UICollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier: reuseIdentifier
97+ forIndexPath: indexPath];
9298
9399 if (self.configureCellBlock ) {
94100 self.configureCellBlock (cell, item);
0 commit comments