mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2026-03-21 14:50:24 +00:00
Extract repeating webview cell code into method
This commit is contained in:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user