From f202e985db70637487aef7a49def93c05116a208 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Tue, 8 Sep 2020 17:11:22 -0700 Subject: [PATCH] Fixes incorrect Background Refresh cell style pre-iOS 14 --- AltStore/Settings/SettingsViewController.swift | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/AltStore/Settings/SettingsViewController.swift b/AltStore/Settings/SettingsViewController.swift index bfff6c76..524eabca 100644 --- a/AltStore/Settings/SettingsViewController.swift +++ b/AltStore/Settings/SettingsViewController.swift @@ -372,6 +372,22 @@ extension SettingsViewController } } + override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell + { + let cell = super.tableView(tableView, cellForRowAt: indexPath) + + if #available(iOS 14, *) {} + else if let cell = cell as? InsetGroupTableViewCell, + indexPath.section == Section.appRefresh.rawValue, + indexPath.row == AppRefreshRow.backgroundRefresh.rawValue + { + // Only one row is visible pre-iOS 14. + cell.style = .single + } + + return cell + } + override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { let section = Section.allCases[section]