From fbf3422cab06e748a42da822965869a5b9f96e87 Mon Sep 17 00:00:00 2001 From: Vegard Bieker Matthey Date: Tue, 4 Aug 2026 19:47:08 +0200 Subject: [PATCH] reset color by using the default --- ImageViewer/ViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ImageViewer/ViewController.swift b/ImageViewer/ViewController.swift index b5be9a3..071e552 100644 --- a/ImageViewer/ViewController.swift +++ b/ImageViewer/ViewController.swift @@ -2123,6 +2123,7 @@ struct ComicOptionItem { class ComicOptionViewController: UITableViewController { private let items: [ComicOptionItem] + private var defaultTextColor: UIColor? init(title: String, items: [ComicOptionItem]) { self.items = items @@ -2155,6 +2156,9 @@ class ComicOptionViewController: UITableViewController { let item = items[indexPath.row] cell.textLabel?.text = item.title cell.accessoryType = item.children != nil ? .disclosureIndicator : .none + if cell.textLabel?.textColor != .red && cell.textLabel?.textColor != .gray { + defaultTextColor = cell.textLabel?.textColor + } let available = item.available() @@ -2164,7 +2168,7 @@ class ComicOptionViewController: UITableViewController { if item.destructive { cell.textLabel?.textColor = .red } else { - cell.textLabel?.textColor = .white + cell.textLabel?.textColor = defaultTextColor ?? .black } } else { cell.textLabel?.textColor = .gray