From 8e6c1f313ecffbda2372dcc2dfacff1eea1e1a21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Spie=C3=9F?= Date: Wed, 25 Nov 2015 13:08:21 +0100 Subject: [PATCH] Extract repeating webview cell code into method --- Classes/BITUpdateViewController.m | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Classes/BITUpdateViewController.m b/Classes/BITUpdateViewController.m index abc084cc27..553a09a646 100644 --- a/Classes/BITUpdateViewController.m +++ b/Classes/BITUpdateViewController.m @@ -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];