Extract repeating webview cell code into method

This commit is contained in:
Lukas Spieß
2015-11-25 13:08:21 +01:00
parent f801f47ef8
commit 8e6c1f313e

View File

@@ -393,9 +393,8 @@
}
}
}
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
[self configureWebCell:cell forAppVersion:appVersion];
BITWebTableViewCell *cell = [self webCellWithAppVersion:appVersion];
[_cells addObject:cell];
if (breakAfterThisAppVersion) break;
@@ -405,6 +404,12 @@
[self showHidePreviousVersionsButton];
}
- (BITWebTableViewCell *)webCellWithAppVersion:(BITAppVersionMetaInfo *)appVersion {
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
[self configureWebCell:cell forAppVersion:appVersion];
return cell;
}
- (void)showPreviousVersionAction {
_showAllVersions = YES;
BOOL showAllPending = NO;
@@ -420,10 +425,8 @@
continue; // skip already shown
}
}
BITWebTableViewCell *cell = [[BITWebTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:kWebCellIdentifier];
[self configureWebCell:cell forAppVersion:appVersion];
[_cells addObject:cell];
[_cells addObject:[self webCellWithAppVersion:appVersion]];
}
[self.tableView reloadData];
[self showHidePreviousVersionsButton];