File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -94,10 +94,9 @@ - (void)configureCell:(FDFeedCell *)cell atIndexPath:(NSIndexPath *)indexPath {
9494
9595- (CGFloat)tableView : (UITableView *)tableView heightForRowAtIndexPath : (NSIndexPath *)indexPath {
9696 FDSimulatedCacheMode mode = self.cacheModeSegmentControl .selectedSegmentIndex ;
97- NSString *reuseIdentifier = @" FDFeedCell" ;
9897 switch (mode) {
9998 case FDSimulatedCacheModeNone:
100- return [tableView fd_heightForCellWithIdentifier: reuseIdentifier configuration: ^(FDFeedCell *cell) {
99+ return [tableView fd_heightForCellWithIdentifier: @" FDFeedCell " configuration: ^(FDFeedCell *cell) {
101100 [self configureCell: cell atIndexPath: indexPath];
102101 }];
103102 case FDSimulatedCacheModeCacheByIndexPath:
@@ -169,11 +168,12 @@ - (FDFeedEntity *)randomEntity {
169168
170169- (void )insertRow {
171170 if (self.feedEntitySections .count == 0 ) {
172- self.feedEntitySections [0 ] = @[].mutableCopy ;
171+ [self insertSection ];
172+ } else {
173+ [self .feedEntitySections[0 ] insertObject: self .randomEntity atIndex: 0 ];
174+ NSIndexPath *indexPath = [NSIndexPath indexPathForRow: 0 inSection: 0 ];
175+ [self .tableView insertRowsAtIndexPaths: @[indexPath] withRowAnimation: UITableViewRowAnimationAutomatic];
173176 }
174- [self .feedEntitySections[0 ] insertObject: self .randomEntity atIndex: 0 ];
175- NSIndexPath *indexPath = [NSIndexPath indexPathForRow: 0 inSection: 0 ];
176- [self .tableView insertRowsAtIndexPaths: @[indexPath] withRowAnimation: UITableViewRowAnimationAutomatic];
177177}
178178
179179- (void )insertSection {
You can’t perform that action at this time.
0 commit comments