From 5cc277c34034315041986f9270c17fe251bb6300 Mon Sep 17 00:00:00 2001 From: Dave Nicolson Date: Fri, 9 Oct 2020 08:03:44 +0200 Subject: [PATCH] Change save game colour on tvOS --- Quake2-iOS/SavedGameViewController.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Quake2-iOS/SavedGameViewController.swift b/Quake2-iOS/SavedGameViewController.swift index 1913868..491f15f 100644 --- a/Quake2-iOS/SavedGameViewController.swift +++ b/Quake2-iOS/SavedGameViewController.swift @@ -69,6 +69,15 @@ extension SavedGameViewController: UITableViewDelegate { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { selectedSavedGame = saves[indexPath.row] loadGameButton.isHidden = false + #if os(tvOS) + tableView.cellForRow(at: indexPath)?.contentView.backgroundColor = .lightGray + #endif + } + + func tableView(_ tableView: UITableView, didDeselectRowAt indexPath: IndexPath) { + #if os(tvOS) + tableView.cellForRow(at: indexPath)?.contentView.backgroundColor = .none + #endif } // func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { @@ -86,6 +95,9 @@ extension SavedGameViewController: UITableViewDataSource { let cell = tableView.dequeueReusableCell(withIdentifier: "cell")! cell.textLabel?.text = saves[indexPath.row]//.replacingOccurrences(of: ".svg", with: "") + #if os(tvOS) + cell.textLabel?.textColor = .black + #endif return cell }