Fix undefined key in Theming iOS Apps

This commit is contained in:
Shadowfacts 2023-03-21 10:00:58 -04:00
parent a73c9a6cf4
commit 80bc331721
1 changed files with 2 additions and 2 deletions

View File

@ -30,11 +30,11 @@ With a simple extension on `UITraitCollection`, you can make it look like any ot
extension UITraitCollection {
var pureBlackDarkMode: Bool {
get {
(value(forKey: "_clientDefinedTraits") as? [String: Any])?[key] as? Bool ?? true
(value(forKey: "_clientDefinedTraits") as? [String: Any])?["tusker_usePureBlackDarkMode"] as? Bool ?? true
}
set {
var dict = value(forKey: "_clientDefinedTraits") as? [String: Any] ?? [:]
dict[key] = newValue
dict["tusker_usePureBlackDarkMode"] = newValue
setValue(dict, forKey: "_clientDefinedTraits")
}
}